<s> """<STR_LIT>""" <EOL> __revision__ = "<STR_LIT>" <EOL> __all__ = [ '<STR_LIT>' , ] <EOL> import os <EOL> import os . path <EOL> import SCons . Errors <EOL> class _PathVariableClass ( object ) : <EOL> def PathAccept ( self , key , val , env ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def PathIsDir ( self , key , val , env ) : <EOL> """<STR_LIT>""" <EOL> if not os . path . isdir ( val ) : <EOL> if os . path . isfile ( val ) : <EOL> m = '<STR_LIT>' <EOL> else : <EOL> m = '<STR_LIT>' <EOL> raise SCons . Errors . UserError ( m % ( key , val ) ) <EOL> def PathIsDirCreate ( self , key , val , env ) : <EOL> """<STR_LIT>""" <EOL> if os . path . isfile ( val ) : <EOL> m = '<STR_LIT>' <EOL> raise SCons . Errors . UserError ( m % ( key , val ) ) <EOL> if not os . path . isdir ( val ) : <EOL> os . makedirs ( val ) <EOL> def PathIsFile ( self , key , val , env ) : <EOL> """<STR_LIT>""" <EOL> if not os . path . isfile ( val ) : <EOL> if os . path . isdir ( val ) : <EOL> m = '<STR_LIT>' <EOL> else : <EOL> m = '<STR_LIT>' <EOL> raise SCons . Errors . UserError ( m % ( key , val ) ) <EOL> def PathExists ( self , key , val , env ) : <EOL> """<STR_LIT>""" <EOL> if not os . path . exists ( val ) : <EOL> m = '<STR_LIT>' <EOL> raise SCons . Errors . UserError ( m % ( key , val ) ) <EOL> def __call__ ( self , key , help , default , validator = None ) : <EOL> """<STR_LIT>""" <EOL> if validator is None : <EOL> validator = self . PathExists <EOL> if SCons . Util . is_List ( key ) or SCons . Util . is_Tuple ( key ) : <EOL> return ( key , '<STR_LIT>' % ( help , key [ <NUM_LIT:0> ] ) , default , <EOL> validator , None ) <EOL> else : <EOL> return ( key , '<STR_LIT>' % ( help , key ) , default , <EOL> validator , None ) <EOL> PathVariable = _PathVariableClass ( ) </s>
