diff options
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): |