<s> """<STR_LIT>""" <EOL> __revision__ = "<STR_LIT>" <EOL> import os <EOL> from stat import ST_MTIME <EOL> from distutils . errors import DistutilsFileError <EOL> def newer ( source , target ) : <EOL> """<STR_LIT>""" <EOL> if not os . path . exists ( source ) : <EOL> raise DistutilsFileError ( "<STR_LIT>" % <EOL> os . path . abspath ( source ) ) <EOL> if not os . path . exists ( target ) : <EOL> return True <EOL> return os . stat ( source ) [ ST_MTIME ] > os . stat ( target ) [ ST_MTIME ] <EOL> def newer_pairwise ( sources , targets ) : <EOL> """<STR_LIT>""" <EOL> if len ( sources ) != len ( targets ) : <EOL> raise ValueError , "<STR_LIT>" <EOL> n_sources = [ ] <EOL> n_targets = [ ] <EOL> for source , target in zip ( sources , targets ) : <EOL> if newer ( source , target ) : <EOL> n_sources . append ( source ) <EOL> n_targets . append ( target ) <EOL> return n_sources , n_targets <EOL> def newer_group ( sources , target , missing = '<STR_LIT:error>' ) : <EOL> """<STR_LIT>""" <EOL> if not os . path . exists ( target ) : <EOL> return True <EOL> target_mtime = os . stat ( target ) [ ST_MTIME ] <EOL> for source in sources : <EOL> if not os . path . exists ( source ) : <EOL> if missing == '<STR_LIT:error>' : <EOL> pass <EOL> elif missing == '<STR_LIT:ignore>' : <EOL> continue <EOL> elif missing == '<STR_LIT>' : <EOL> return True <EOL> if os . stat ( source ) [ ST_MTIME ] > target_mtime : <EOL> return True <EOL> return False </s>
