mirror of
https://github.com/python/cpython.git
synced 2025-11-23 20:07:19 +00:00
Whitespace normalization, via reindent.py.
This commit is contained in:
parent
e6ddc8b20b
commit
182b5aca27
453 changed files with 31318 additions and 31452 deletions
|
|
@ -26,50 +26,50 @@ import macmodulefinder
|
|||
#
|
||||
|
||||
def main():
|
||||
if len(sys.argv) < 2:
|
||||
gentype, program, output, debug = macfreezegui.dialog()
|
||||
elif len(sys.argv) == 2:
|
||||
gentype, program, output, debug = macfreezegui.dialog(sys.argv[1])
|
||||
else:
|
||||
EasyDialog.Message(
|
||||
"Please pass a single script. Additional modules can be specified with directives")
|
||||
sys.exit(0)
|
||||
mustwait = process(gentype, program, output, debug=debug)
|
||||
if mustwait:
|
||||
sys.exit(1)
|
||||
if len(sys.argv) < 2:
|
||||
gentype, program, output, debug = macfreezegui.dialog()
|
||||
elif len(sys.argv) == 2:
|
||||
gentype, program, output, debug = macfreezegui.dialog(sys.argv[1])
|
||||
else:
|
||||
EasyDialog.Message(
|
||||
"Please pass a single script. Additional modules can be specified with directives")
|
||||
sys.exit(0)
|
||||
mustwait = process(gentype, program, output, debug=debug)
|
||||
if mustwait:
|
||||
sys.exit(1)
|
||||
|
||||
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
|
||||
#
|
||||
if gentype == 'info':
|
||||
import macgen_info
|
||||
macgen_info.generate(output, module_dict)
|
||||
return 1 # So the user can inspect it
|
||||
elif gentype == 'source':
|
||||
import macgen_src
|
||||
warnings = macgen_src.generate(output, module_dict, debug, with_ifdef)
|
||||
return warnings
|
||||
elif gentype == 'resource':
|
||||
import macgen_rsrc
|
||||
macgen_rsrc.generate(output, module_dict, debug)
|
||||
warnings = macgen_rsrc.warnings(module_dict)
|
||||
return warnings
|
||||
elif gentype == 'applet':
|
||||
import macgen_bin
|
||||
architecture = 'fat' # user should choose
|
||||
macgen_bin.generate(program, output, module_dict, architecture, debug)
|
||||
else:
|
||||
raise 'unknown gentype', gentype
|
||||
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
|
||||
#
|
||||
if gentype == 'info':
|
||||
import macgen_info
|
||||
macgen_info.generate(output, module_dict)
|
||||
return 1 # So the user can inspect it
|
||||
elif gentype == 'source':
|
||||
import macgen_src
|
||||
warnings = macgen_src.generate(output, module_dict, debug, with_ifdef)
|
||||
return warnings
|
||||
elif gentype == 'resource':
|
||||
import macgen_rsrc
|
||||
macgen_rsrc.generate(output, module_dict, debug)
|
||||
warnings = macgen_rsrc.warnings(module_dict)
|
||||
return warnings
|
||||
elif gentype == 'applet':
|
||||
import macgen_bin
|
||||
architecture = 'fat' # user should choose
|
||||
macgen_bin.generate(program, output, module_dict, architecture, debug)
|
||||
else:
|
||||
raise 'unknown gentype', gentype
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue