summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJust van Rossum <just@lettererror.com>1999-11-04 10:28:59 (GMT)
committerJust van Rossum <just@lettererror.com>1999-11-04 10:28:59 (GMT)
commit2e5b0f2166cb0b8a8d2152af8fa3817d0d2f66cf (patch)
tree21eeadc927854fafe312c04ca3ef0f323aac3781
parent8ff52764efbeb7e88dd96de2ef3209b17ab5c5f6 (diff)
downloadcpython-2e5b0f2166cb0b8a8d2152af8fa3817d0d2f66cf.zip
cpython-2e5b0f2166cb0b8a8d2152af8fa3817d0d2f66cf.tar.gz
cpython-2e5b0f2166cb0b8a8d2152af8fa3817d0d2f66cf.tar.bz2
Adapted to new macmudulefinder.process() API. (jvr)
-rw-r--r--Mac/Tools/macfreeze/macfreeze.py15
-rw-r--r--Mac/Tools/macfreeze/macgen_bin.py11
2 files changed, 18 insertions, 8 deletions
diff --git a/Mac/Tools/macfreeze/macfreeze.py b/Mac/Tools/macfreeze/macfreeze.py
index 8c7a7da..8a2ca76 100644
--- a/Mac/Tools/macfreeze/macfreeze.py
+++ b/Mac/Tools/macfreeze/macfreeze.py
@@ -38,12 +38,15 @@ def main():
if mustwait:
sys.exit(1)
-def process(gentype, program, output, modules=[], module_files=[], debug=0, with_ifdef=0):
- try:
- module_dict = macmodulefinder.process(program, modules, module_files, debug)
- except macmodulefinder.Missing, arg:
- arg.sort()
- print '** Missing modules:', string.join(arg, ' ')
+def process(gentype, program, output, modules=None, module_files=None, debug=0, with_ifdef=0):
+ if modules is None:
+ modules = []
+ if module_files is None:
+ module_files = []
+ module_dict, missing = macmodulefinder.process(program, modules, module_files, debug)
+ if missing:
+ missing.sort()
+ print '** Missing modules:', string.join(missing, ' ')
sys.exit(1)
#
# And generate
diff --git a/Mac/Tools/macfreeze/macgen_bin.py b/Mac/Tools/macfreeze/macgen_bin.py
index f3b97b3..04260ed 100644
--- a/Mac/Tools/macfreeze/macgen_bin.py
+++ b/Mac/Tools/macfreeze/macgen_bin.py
@@ -12,7 +12,7 @@ import cfmfile
import buildtools
-def generate(input, output, module_dict = None, architecture = 'fat', debug=0):
+def generate(input, output, module_dict=None, architecture='fat', debug=0):
# try to remove old file
try:
os.remove(output)
@@ -22,7 +22,14 @@ def generate(input, output, module_dict = None, architecture = 'fat', debug=0):
if module_dict is None:
import macmodulefinder
print "Searching for modules..."
- module_dict = macmodulefinder.process(input, [], [], 1)
+ module_dict, missing = macmodulefinder.process(input, [], [], 1)
+ if missing:
+ import EasyDialogs
+ missing.sort()
+ answer = EasyDialogs.AskYesNoCancel("Some modules could not be found; continue anyway?\n(%s)"
+ % string.join(missing, ", "))
+ if answer <> 1:
+ sys.exit(0)
applettemplatepath = buildtools.findtemplate()
corepath = findpythoncore()