summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/cvsfiles.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-08-02 22:53:22 (GMT)
committerGeorg Brandl <georg@python.org>2010-08-02 22:53:22 (GMT)
commitd3f467ac7441a100eb26412424c2dd96ec3ceb67 (patch)
tree4aa8ff69b527682837f5876bbb5166396db36bec /Tools/scripts/cvsfiles.py
parentf7db42fe8cfc412c8d247a40f48eac43687ec9c7 (diff)
downloadcpython-d3f467ac7441a100eb26412424c2dd96ec3ceb67.zip
cpython-d3f467ac7441a100eb26412424c2dd96ec3ceb67.tar.gz
cpython-d3f467ac7441a100eb26412424c2dd96ec3ceb67.tar.bz2
Update README, remove obsolete scripts.
Diffstat (limited to 'Tools/scripts/cvsfiles.py')
-rwxr-xr-xTools/scripts/cvsfiles.py72
1 files changed, 0 insertions, 72 deletions
diff --git a/Tools/scripts/cvsfiles.py b/Tools/scripts/cvsfiles.py
deleted file mode 100755
index 0fc13bb..0000000
--- a/Tools/scripts/cvsfiles.py
+++ /dev/null
@@ -1,72 +0,0 @@
-#! /usr/bin/env python3
-
-"""Print a list of files that are mentioned in CVS directories.
-
-Usage: cvsfiles.py [-n file] [directory] ...
-
-If the '-n file' option is given, only files under CVS that are newer
-than the given file are printed; by default, all files under CVS are
-printed. As a special case, if a file does not exist, it is always
-printed.
-"""
-
-import os
-import sys
-import stat
-import getopt
-
-cutofftime = 0
-
-def main():
- try:
- opts, args = getopt.getopt(sys.argv[1:], "n:")
- except getopt.error as msg:
- print(msg)
- print(__doc__, end=' ')
- return 1
- global cutofftime
- newerfile = None
- for o, a in opts:
- if o == '-n':
- cutofftime = getmtime(a)
- if args:
- for arg in args:
- process(arg)
- else:
- 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)
- if cvsdir:
- entries = os.path.join(cvsdir, "Entries")
- for e in open(entries).readlines():
- words = e.split('/')
- 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)
-
-def getmtime(filename):
- try:
- st = os.stat(filename)
- except os.error:
- return 0
- return st[stat.ST_MTIME]
-
-if __name__ == '__main__':
- main()