나는, SCons는 우리 자신의 결정자 함수를 작성하는 방법을 인터넷에서 검색 소스 파일은 다음과 같이 다시 작성해야 할 때 어떻게 /에 관해서 :scons 맞춤식 결정 기능은 반원이어야합니까?
나는에서는 hello.c있어Program('hello.c')
def decide_if_changed(dependency,target,prev_ni):
if self.get_timestamp()!=prev_ni.timestamp:
dep=str(dependency)
tgt=str(target)
if specific_part_of_file_has_changed(dep,tgt):
return true;
return false;
Decider(decide_if_changed)
, 아무 문제 SCons는 실행시,하지만 파이썬 오류 메시지를 표시 :
$ scons -Q
scons: *** [o.o] NameError : global name 'self' is not defined
자체가 클래스 멤버 함수를 언급 파이썬 키워드입니다. 여기 SContruct 파일에는 클래스가 있지만 단지 decide_if_changed 함수가 있습니다. 질문 :
Do I have to add a class here? Why it prompts python error saying 'self' is not defined?
This example script a function call of specific_part_of_file_has_changed, is it a scons's own file that can be called by any pythong statement?