mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Moved to Unsupported.
This commit is contained in:
parent
f913e542be
commit
9c940ca143
10 changed files with 18 additions and 0 deletions
39
Mac/Unsupported/mkfrozenresources.py
Normal file
39
Mac/Unsupported/mkfrozenresources.py
Normal file
|
@ -0,0 +1,39 @@
|
|||
#
|
||||
# Given a module-list generated by findmodulefiles
|
||||
# generate the resource file with all needed modules
|
||||
#
|
||||
import macfs
|
||||
import py_resource
|
||||
import Res
|
||||
import sys
|
||||
|
||||
def main():
|
||||
fss, ok = macfs.PromptGetFile('Module sources listing:', 'TEXT')
|
||||
if not ok:
|
||||
sys.exit(0)
|
||||
ofss, ok = macfs.StandardPutFile('PYC resource output file:')
|
||||
if not ok:
|
||||
sys.exit(0)
|
||||
mfss, ok = macfs.PromptGetFile('Source for __main__ (or cancel):')
|
||||
if ok:
|
||||
mainfile = mfss.as_pathname()
|
||||
else:
|
||||
mainfile = None
|
||||
fp = open(fss.as_pathname())
|
||||
data = fp.read()
|
||||
modules = eval(data)
|
||||
|
||||
fsid = py_resource.create(ofss.as_pathname(), creator='RSED')
|
||||
|
||||
if mainfile:
|
||||
id, name = py_resource.frompyfile(mainfile, '__main__')
|
||||
for module, source in modules:
|
||||
if source:
|
||||
id, name = py_resource.frompyfile(source)
|
||||
print 'Wrote %d %s: %s'%(id, name, source)
|
||||
|
||||
Res.CloseResFile(fsid)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
sys.exit(1)
|
Loading…
Add table
Add a link
Reference in a new issue