mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
give in to tab police
This commit is contained in:
parent
3db0e3713c
commit
ed5b3d8b3c
6 changed files with 440 additions and 435 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue