summaryrefslogtreecommitdiff
path: root/Mac/Tools/macfreeze/directives.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1999-06-04 15:56:33 +0000
committerJack Jansen <jack.jansen@cwi.nl>1999-06-04 15:56:33 +0000
commit995b2136d8ab579fefcd72dcd12b0b70a0ca8360 (patch)
tree9ab617dce8dfe239512d423f2de6b13333abd8f3 /Mac/Tools/macfreeze/directives.py
parent784852cd258d55fbc686dd4465a5d3149dc3fb71 (diff)
downloadcpython-995b2136d8ab579fefcd72dcd12b0b70a0ca8360.tar.gz
Added an "optional" directive, that will include a module if it is available
but not complain if it isn't (giving an ImportError when the frozen code is run).
Diffstat (limited to 'Mac/Tools/macfreeze/directives.py')
-rw-r--r--Mac/Tools/macfreeze/directives.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Mac/Tools/macfreeze/directives.py b/Mac/Tools/macfreeze/directives.py
index e23374589a..16b7879e5b 100644
--- a/Mac/Tools/macfreeze/directives.py
+++ b/Mac/Tools/macfreeze/directives.py
@@ -18,6 +18,7 @@ REPROG=re.compile(DIRECTIVE_RE)
def findfreezedirectives(program):
extra_modules = []
exclude_modules = []
+ optional_modules = []
extra_path = []
progdir, filename = os.path.split(program)
fp = open(program)
@@ -30,10 +31,12 @@ def findfreezedirectives(program):
extra_modules.append(argument)
elif directive == 'exclude':
exclude_modules.append(argument)
+ elif directive == 'optional':
+ optional_modules.append(argument)
elif directive == 'path':
argument = os.path.join(progdir, argument)
extra_path.append(argument)
else:
print '** Unknown directive', line
- return extra_modules, exclude_modules, extra_path
+ return extra_modules, exclude_modules, optional_modules, extra_path