| |
253 |
def main():
|
| |
254 |
configfile = os.path.join(HOME, 'config.dat')
|
| |
255 |
try:
|
| |
256 |
config = eval(open(configfile, 'r').read())
|
| |
257 |
except IOError, SyntaxError:
|
| |
258 |
# IOerror: file not present
|
| |
259 |
# SyntaxError: invalid file (platform change?)
|
| |
260 |
config = {'useELFEXE':1} # if not set by Make.py we can assume Windows
|
| |
261 |
|
| |
262 |
# Save Python version, to detect and avoid conflicts
|
| |
263 |
config["pythonVersion"] = sys.version
|
| |
264 |
|
| |
265 |
find_EXE_dependencies(config)
|
| |
266 |
test_TCL_TK(config)
|
| |
267 |
test_Zlib(config)
|
| |
268 |
test_RsrcUpdate(config)
|
| |
269 |
test_unicode(config)
|
| |
270 |
test_UPX(config)
|
| |
271 |
find_PYZ_dependencies(config)
|
| |
272 |
|
| |
273 |
Build._save_data(configfile, config)
|
| |
274 |
print "I: config.dat generation done!"
|
| |
275 |
|
| |
276 |
|
| |
277 |
if __name__ == '__main__':
|
| |
278 |
from optparse import OptionParser
|
| |
279 |
parser = OptionParser(usage="%prog [options]")
|
| |
280 |
parser.add_option('--target-platform', default=None,
|
| |
281 |
help='Target platform, required for cross-bundling '
|
| |
282 |
'(default: current platform).')
|
| |
283 |
parser.add_option('--executable', default=None,
|
| |
284 |
help='Python executable to use. Required for '
|
| |
285 |
'cross-bundling.')
|
| |
286 |
|
| |
287 |
opts, args = parser.parse_args()
|
| |
288 |
if args:
|
| |
289 |
parser.error('Does not expect any arguments')
|
| 254 |
|
from optparse import OptionParser
|
| 255 |
|
parser = OptionParser(usage="%prog [options] <executable_or_dynamic_library>")
|
| 256 |
|
parser.add_option('--target-platform', default=None,
|
| 257 |
|
help='Target platform, required for cross-bundling (default: current platform).')
|
| 258 |
|
parser.add_option('--executable', default=None,
|
| 259 |
|
help='Python executable to use. Required for cross-bundling.')
|
| 260 |
|
|
| 261 |
|
opts, args = parser.parse_args()
|
| 262 |
|
if args:
|
| 263 |
|
parser.error('Does not expect any arguments')
|
| 264 |
|
|
| 265 |
|
configfile = os.path.join(HOME, 'config.dat')
|
| 266 |
|
try:
|
| 267 |
|
config = eval(open(configfile, 'r').read())
|
| 268 |
|
except IOError, SyntaxError:
|
| 269 |
|
# IOerror: file not present
|
| 270 |
|
# SyntaxError: invalid file (platform change?)
|
| 271 |
|
config = {'useELFEXE':1} # if not set by Make.py we can assume Windows
|
| 272 |
|
|
| 273 |
|
# Save Python version, to detect and avoid conflicts
|
| 274 |
|
config["pythonVersion"] = sys.version
|
| 275 |
|
|
| 276 |
|
find_EXE_dependencies(config)
|
| 277 |
|
test_TCL_TK(config)
|
| 278 |
|
test_Zlib(config)
|
| 279 |
|
test_RsrcUpdate(config)
|
| 280 |
|
test_unicode(config)
|
| 281 |
|
test_UPX(config)
|
| 282 |
|
find_PYZ_dependencies(config)
|
| 283 |
|
|
| 284 |
|
Build._save_data(configfile, config)
|
| 285 |
|
print "I: config.dat generation done!"
|
| |
291 |
main()
|