home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 October / maximum-cd-2011-10.iso / DiscContents / digsby_setup.exe / lib / distutils / dep_util.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2011-06-22  |  1.6 KB  |  50 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  3.  
  4. __revision__ = '$Id: dep_util.py 58049 2007-09-08 00:34:17Z skip.montanaro $'
  5. import os
  6. from distutils.errors import DistutilsFileError
  7.  
  8. def newer(source, target):
  9.     if not os.path.exists(source):
  10.         raise DistutilsFileError, "file '%s' does not exist" % os.path.abspath(source)
  11.     os.path.exists(source)
  12.     if not os.path.exists(target):
  13.         return 1
  14.     ST_MTIME = ST_MTIME
  15.     import stat
  16.     mtime1 = os.stat(source)[ST_MTIME]
  17.     mtime2 = os.stat(target)[ST_MTIME]
  18.     return mtime1 > mtime2
  19.  
  20.  
  21. def newer_pairwise(sources, targets):
  22.     if len(sources) != len(targets):
  23.         raise ValueError, "'sources' and 'targets' must be same length"
  24.     len(sources) != len(targets)
  25.     n_sources = []
  26.     n_targets = []
  27.     for i in range(len(sources)):
  28.         if newer(sources[i], targets[i]):
  29.             n_sources.append(sources[i])
  30.             n_targets.append(targets[i])
  31.             continue
  32.     
  33.     return (n_sources, n_targets)
  34.  
  35.  
  36. def newer_group(sources, target, missing = 'error'):
  37.     if not os.path.exists(target):
  38.         return 1
  39.     ST_MTIME = ST_MTIME
  40.     import stat
  41.     target_mtime = os.stat(target)[ST_MTIME]
  42.     for source in sources:
  43.         source_mtime = os.stat(source)[ST_MTIME]
  44.         if source_mtime > target_mtime:
  45.             return 1
  46.     else:
  47.         return 0
  48.     return source_mtime > target_mtime
  49.  
  50.