<s> """<STR_LIT>""" <EOL> import sys <EOL> import os <EOL> import platform <EOL> FilePath = '<STR_LIT>' <EOL> LineNumber = <NUM_LIT:0> <EOL> Env = { } <EOL> def error ( msg ) : <EOL> '''<STR_LIT>''' <EOL> print ( "<STR_LIT>" . format ( msg ) ) <EOL> sys . exit ( <NUM_LIT:10> ) <EOL> def setErrorLocation ( filePath , lineNumber ) : <EOL> global FilePath <EOL> global LineNumber <EOL> FilePath = filePath <EOL> LineNumber = lineNumber <EOL> def fmtError ( msg , terminate = True ) : <EOL> '''<STR_LIT>''' <EOL> if platform . system ( ) == '<STR_LIT>' : <EOL> print ( '<STR_LIT>' . format ( FilePath , LineNumber + <NUM_LIT:1> , msg ) ) <EOL> else : <EOL> print ( '<STR_LIT>' . format ( FilePath , LineNumber + <NUM_LIT:1> , msg ) ) <EOL> if terminate : <EOL> sys . exit ( <NUM_LIT:10> ) <EOL> def fmtWarning ( msg ) : <EOL> '''<STR_LIT>''' <EOL> if platform . system ( ) == '<STR_LIT>' : <EOL> print ( '<STR_LIT>' . format ( FilePath , LineNumber + <NUM_LIT:1> , msg ) ) <EOL> else : <EOL> print ( '<STR_LIT>' . format ( FilePath , LineNumber + <NUM_LIT:1> , msg ) ) <EOL> def fileVersionDirty ( filePath , version ) : <EOL> '''<STR_LIT>''' <EOL> f = open ( filePath , '<STR_LIT:r>' ) <EOL> for i in range ( <NUM_LIT:0> , <NUM_LIT:4> ) : <EOL> line = f . readline ( ) <EOL> startIndex = line . find ( '<STR_LIT>' ) <EOL> if startIndex != - <NUM_LIT:1> : <EOL> endIndex = line . find ( '<STR_LIT:#>' , startIndex + <NUM_LIT:9> ) <EOL> if endIndex != - <NUM_LIT:1> : <EOL> versionNumber = line [ startIndex + <NUM_LIT:9> : endIndex ] <EOL> if int ( versionNumber ) == version : <EOL> return False <EOL> return True <EOL> def isDirty ( version , inputs , outputs ) : <EOL> '''<STR_LIT>''' <EOL> for output in outputs : <EOL> if version : <EOL> if fileVersionDirty ( output , version ) : <EOL> return True <EOL> outputTime = os . path . getmtime ( output ) <EOL> for input in inputs : <EOL> inputTime = os . path . getmtime ( input ) <EOL> if inputTime > outputTime : <EOL> return True <EOL> return False <EOL> def setEnv ( dic ) : <EOL> '''<STR_LIT>''' <EOL> global Env <EOL> Env = dic <EOL> def getEnv ( key ) : <EOL> '''<STR_LIT>''' <EOL> global Env <EOL> return Env [ key ] </s>
