[Python-checkins] python/dist/src/Lib/plat-mac gensuitemodule.py,NONE,1.1
jackjansen@users.sourceforge.net
jackjansen@users.sourceforge.net
Sat, 29 Mar 2003 15:04:02 -0800
Update of /cvsroot/python/python/dist/src/Lib/plat-mac
In directory sc8-pr-cvs1:/tmp/cvs-serv11296/Lib/plat-mac
Added Files:
gensuitemodule.py
Log Message:
Moved gensuitemodule from Mac/scripts to Lib/plat-mac. Documentation
remains to be done.
--- NEW FILE: gensuitemodule.py ---
"""
gensuitemodule - Generate an AE suite module from an aete/aeut resource
Based on aete.py.
Reading and understanding this code is left as an exercise to the reader.
"""
import MacOS
import EasyDialogs
import os
import string
import sys
import types
import StringIO
import keyword
import macresource
import aetools
import distutils.sysconfig
[...1093 lines suppressed...]
rv = ''
ok = string.ascii_letters + '_'
ok2 = ok + string.digits
for c in str:
if c in ok:
rv = rv + c
elif c == ' ':
rv = rv + '_'
else:
rv = rv + '_%02.2x_'%ord(c)
ok = ok2
if keyword.iskeyword(rv):
rv = rv + '_'
return rv
# Call the main program
if __name__ == '__main__':
main()
sys.exit(1)