mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Support for freezing packages (Just).
This commit is contained in:
parent
201f46de2c
commit
b93f52158b
4 changed files with 58 additions and 12 deletions
|
@ -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:
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue