diff options
author | Guido van Rossum <guido@python.org> | 1998-03-24 05:30:29 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-03-24 05:30:29 (GMT) |
commit | ed5b3d8b3c8077c8c57c8a825cae06e319b0994d (patch) | |
tree | f200df16bbb012dcfe74b75a990c32709e80f44a /Tools/scripts/cvsfiles.py | |
parent | 3db0e3713cd59d1c922002056f11ae5caf02805c (diff) | |
download | cpython-ed5b3d8b3c8077c8c57c8a825cae06e319b0994d.zip cpython-ed5b3d8b3c8077c8c57c8a825cae06e319b0994d.tar.gz cpython-ed5b3d8b3c8077c8c57c8a825cae06e319b0994d.tar.bz2 |
give in to tab police
Diffstat (limited to 'Tools/scripts/cvsfiles.py')
-rwxr-xr-x | Tools/scripts/cvsfiles.py | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/Tools/scripts/cvsfiles.py b/Tools/scripts/cvsfiles.py index 5b691f6..d133a40 100755 --- a/Tools/scripts/cvsfiles.py +++ b/Tools/scripts/cvsfiles.py @@ -20,53 +20,53 @@ cutofftime = 0 def main(): try: - opts, args = getopt.getopt(sys.argv[1:], "n:") + opts, args = getopt.getopt(sys.argv[1:], "n:") except getopt.error, msg: - print msg - print __doc__, - return 1 + print msg + print __doc__, + return 1 global cutofftime newerfile = None for o, a in opts: - if o == '-n': - cutofftime = getmtime(a) + if o == '-n': + cutofftime = getmtime(a) if args: - for arg in args: - process(arg) + for arg in args: + process(arg) else: - process(".") + process(".") def process(dir): cvsdir = 0 subdirs = [] names = os.listdir(dir) for name in names: - fullname = os.path.join(dir, name) - if name == "CVS": - cvsdir = fullname - else: - if os.path.isdir(fullname): - if not os.path.islink(fullname): - subdirs.append(fullname) + fullname = os.path.join(dir, name) + if name == "CVS": + cvsdir = fullname + else: + if os.path.isdir(fullname): + if not os.path.islink(fullname): + subdirs.append(fullname) if cvsdir: - entries = os.path.join(cvsdir, "Entries") - for e in open(entries).readlines(): - words = string.split(e, '/') - if words[0] == '' and words[1:]: - name = words[1] - fullname = os.path.join(dir, name) - if cutofftime and getmtime(fullname) <= cutofftime: - pass - else: - print fullname + entries = os.path.join(cvsdir, "Entries") + for e in open(entries).readlines(): + words = string.split(e, '/') + if words[0] == '' and words[1:]: + name = words[1] + fullname = os.path.join(dir, name) + if cutofftime and getmtime(fullname) <= cutofftime: + pass + else: + print fullname for sub in subdirs: - process(sub) + process(sub) def getmtime(filename): try: - st = os.stat(filename) + st = os.stat(filename) except os.error: - return 0 + return 0 return st[stat.ST_MTIME] sys.exit(main()) |