summaryrefslogtreecommitdiffstats
path: root/Tools/freeze/modulefinder.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-08-25 14:06:55 (GMT)
committerGuido van Rossum <guido@python.org>1998-08-25 14:06:55 (GMT)
commitbaf0603493f6f1eee073a479497291785b067f61 (patch)
tree7b9b04abcd5d890d1d76d6cd81984b1a0f55ee11 /Tools/freeze/modulefinder.py
parent6c74fea07d42ac6bc3bc078fb13f903f6cdbbcb9 (diff)
downloadcpython-baf0603493f6f1eee073a479497291785b067f61.zip
cpython-baf0603493f6f1eee073a479497291785b067f61.tar.gz
cpython-baf0603493f6f1eee073a479497291785b067f61.tar.bz2
New version, with contributions from Sjoerd Mullender and Mark Hammond.
Sjoerd writes: This version of freeze creates one file per Python module, instead of one humongous file for all Python modules. bkfile: new module to used to write files with backups. No new file is produced if the new contents is identical to the old. New option "-x excluded-module" for modulefinder test program. New option "-i filename" for freeze main program to include a list of options in place of the -i option.
Diffstat (limited to 'Tools/freeze/modulefinder.py')
-rw-r--r--Tools/freeze/modulefinder.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/Tools/freeze/modulefinder.py b/Tools/freeze/modulefinder.py
index 4c54ebd..4985d52 100644
--- a/Tools/freeze/modulefinder.py
+++ b/Tools/freeze/modulefinder.py
@@ -359,14 +359,16 @@ class ModuleFinder:
keys = self.badmodules.keys()
keys.sort()
for key in keys:
- print "?", key
+ # ... but not if they were explicitely excluded.
+ if key not in self.excludes:
+ print "?", key
def test():
# Parse command line
import getopt
try:
- opts, args = getopt.getopt(sys.argv[1:], "dmp:q")
+ opts, args = getopt.getopt(sys.argv[1:], "dmp:qx:")
except getopt.error, msg:
print msg
return
@@ -375,6 +377,7 @@ def test():
debug = 1
domods = 0
addpath = []
+ exclude = []
for o, a in opts:
if o == '-d':
debug = debug + 1
@@ -384,6 +387,8 @@ def test():
addpath = addpath + string.split(a, os.pathsep)
if o == '-q':
debug = 0
+ if o == '-x':
+ exclude.append(a)
# Provide default arguments
if not args:
@@ -401,7 +406,7 @@ def test():
print " ", `item`
# Create the module finder and turn its crank
- mf = ModuleFinder(path, debug)
+ mf = ModuleFinder(path, debug, exclude)
for arg in args[1:]:
if arg == '-m':
domods = 1