1 """macgen_info - Generate PYC resource file only"""
7 def generate(output
, module_dict
, debug
=0, preload
=1):
8 fsid
= py_resource
.create(output
)
10 for name
, module
in module_dict
.items():
11 mtype
= module
.gettype()
12 if mtype
not in ['module', 'package']:
14 location
= module
.__file
__
16 if location
[-4:] == '.pyc':
17 # Attempt corresponding .py
18 location
= location
[:-1]
19 if location
[-3:] != '.py':
20 print '*** skipping', location
23 id, name
= py_resource
.frompyfile(location
, name
, preload
=preload
,
24 ispackage
=mtype
=='package')
26 print 'PYC resource %5d\t%s\t%s'%(id, name
, location
)
28 Res
.CloseResFile(fsid
)
30 def warnings(module_dict
):
32 for name
, module
in module_dict
.items():
33 if module
.gettype() not in ('builtin', 'module', 'package'):
34 problems
= problems
+ 1
35 print 'Warning: %s not included: %s %s'%(name
, module
.gettype(), module
)