blob: eaebee871d385fb69b3cc7f7c1160bf20ee350a9 [file] [log] [blame]
Ronald Oussorenbf91f782006-05-19 18:17:31 +00001"""
2Bootstrap script for IDLE as an application bundle.
3"""
Ronald Oussoren836b0392006-05-14 19:56:34 +00004import sys, os
5
Ronald Oussorenbf91f782006-05-19 18:17:31 +00006from idlelib.PyShell import main
7
8# Change the current directory the user's home directory, that way we'll get
9# a more useful default location in the open/save dialogs.
10os.chdir(os.expanduser('~'))
11
12
Tim Peterscbd7b752006-05-16 23:22:20 +000013# Make sure sys.executable points to the python interpreter inside the
Ronald Oussoren836b0392006-05-14 19:56:34 +000014# framework, instead of at the helper executable inside the application
15# bundle (the latter works, but doesn't allow access to the window server)
16sys.executable = os.path.join(sys.prefix, 'bin', 'python')
17
18# Look for the -psn argument that the launcher adds and remove it, it will
19# only confuse the IDLE startup code.
20for idx, value in enumerate(sys.argv):
21 if value.startswith('-psn_'):
22 del sys.argv[idx]
23 break
24
Ronald Oussorenbf91f782006-05-19 18:17:31 +000025#argvemulator.ArgvCollector().mainloop()
Ronald Oussoren836b0392006-05-14 19:56:34 +000026if __name__ == '__main__':
Tim Peterscbd7b752006-05-16 23:22:20 +000027 main()