From 2e5b0f2166cb0b8a8d2152af8fa3817d0d2f66cf Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Thu, 4 Nov 1999 10:28:59 +0000 Subject: Adapted to new macmudulefinder.process() API. (jvr) --- Mac/Tools/macfreeze/macfreeze.py | 15 +++++++++------ Mac/Tools/macfreeze/macgen_bin.py | 11 +++++++++-- 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() -- cgit v0.12