diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1998-08-18 12:23:11 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1998-08-18 12:23:11 (GMT) |
commit | b93f52158b57707cf94a51d5d66735d666be06d8 (patch) | |
tree | f474c02f0dc8d9ab7bae32e0838c265e10534f3d /Mac/Tools/macfreeze | |
parent | 201f46de2c0ce193209ba24d68ce4ae711cac571 (diff) | |
download | cpython-b93f52158b57707cf94a51d5d66735d666be06d8.zip cpython-b93f52158b57707cf94a51d5d66735d666be06d8.tar.gz cpython-b93f52158b57707cf94a51d5d66735d666be06d8.tar.bz2 |
Support for freezing packages (Just).
Diffstat (limited to 'Mac/Tools/macfreeze')
-rw-r--r-- | Mac/Tools/macfreeze/macgen_bin.py | 7 | ||||
-rw-r--r-- | Mac/Tools/macfreeze/macgen_rsrc.py | 10 |
2 files changed, 11 insertions, 6 deletions
diff --git a/Mac/Tools/macfreeze/macgen_bin.py b/Mac/Tools/macfreeze/macgen_bin.py index a4ee828..e293b63 100644 --- a/Mac/Tools/macfreeze/macgen_bin.py +++ b/Mac/Tools/macfreeze/macgen_bin.py @@ -128,10 +128,12 @@ def getfragname(path, dynamicfiles): def addpythonmodules(module_dict): + # XXX should really use macgen_rsrc.generate(), this does the same, but skips __main__ items = module_dict.items() items.sort() for name, module in items: - if module.gettype() != 'module' or name == "__main__": + mtype = module.gettype() + if mtype not in ['module', 'package'] or name == "__main__": continue location = module.__file__ @@ -143,7 +145,8 @@ def addpythonmodules(module_dict): continue print 'Adding module ³%s²' % name - id, name = py_resource.frompyfile(location, name, preload=0) + id, name = py_resource.frompyfile(location, name, preload=0, + ispackage=mtype=='package') def Pstring(str): if len(str) > 255: diff --git a/Mac/Tools/macfreeze/macgen_rsrc.py b/Mac/Tools/macfreeze/macgen_rsrc.py index 107e734..2619a6a 100644 --- a/Mac/Tools/macfreeze/macgen_rsrc.py +++ b/Mac/Tools/macfreeze/macgen_rsrc.py @@ -6,9 +6,10 @@ import sys def generate(output, module_dict, debug=0, preload=1): fsid = py_resource.create(output) - + for name, module in module_dict.items(): - if module.gettype() != 'module': + mtype = module.gettype() + if mtype not in ['module', 'package']: continue location = module.__file__ @@ -19,10 +20,11 @@ def generate(output, module_dict, debug=0, preload=1): print '*** skipping', location continue - id, name = py_resource.frompyfile(location, name, preload=preload) + id, name = py_resource.frompyfile(location, name, preload=preload, + ispackage=mtype=='package') if debug > 0: print 'PYC resource %5d\t%s\t%s'%(id, name, location) - + Res.CloseResFile(fsid) def warnings(module_dict): |