summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-08-14 20:14:54 (GMT)
committerGuido van Rossum <guido@python.org>1997-08-14 20:14:54 (GMT)
commit30e53c0c399c6cd0d8529bc24d17ba1d1e64b44e (patch)
tree86886b9cd9498c33b52ba608fb5e486e114d97f4 /Tools
parent9189bdabd5711b63158e6697c5aab245ee25bef9 (diff)
downloadcpython-30e53c0c399c6cd0d8529bc24d17ba1d1e64b44e.zip
cpython-30e53c0c399c6cd0d8529bc24d17ba1d1e64b44e.tar.gz
cpython-30e53c0c399c6cd0d8529bc24d17ba1d1e64b44e.tar.bz2
Print a list of files under CVS.
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/cvsfiles.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/Tools/scripts/cvsfiles.py b/Tools/scripts/cvsfiles.py
new file mode 100755
index 0000000..f1642104
--- /dev/null
+++ b/Tools/scripts/cvsfiles.py
@@ -0,0 +1,42 @@
+#! /usr/bin/env python
+
+"""Create a list of files that are mentioned in CVS directories."""
+
+import os
+import sys
+import string
+
+def main():
+ args = sys.argv[1:]
+ if args:
+ for arg in args:
+ process(arg)
+ else:
+ process(".")
+
+def process(dir):
+ cvsdir = 0
+ subdirs = []
+ files = []
+ 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):
+ subdirs.append(fullname)
+ else:
+ files.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]
+ print os.path.join(dir, name)
+ for sub in subdirs:
+ process(sub)
+
+main()
+