blob: 9b5273899f6582f2a6b91ec27db9e0c6dd1b9335 [file] [log] [blame]
Thomas Wouters477c8d52006-05-27 19:21:47 +00001"""
2Bootstrap script for IDLE as an application bundle.
3"""
4import sys, os
5
6from 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.path.expanduser('~/Documents'))
11
12
13# Make sure sys.executable points to the python interpreter inside the
14# framework, instead of at the helper executable inside the application
15# bundle (the latter works, but doesn't allow access to the window server)
Georg Brandlfcaf9102008-07-16 02:17:56 +000016if sys.executable.endswith('-32'):
17 sys.executable = os.path.join(sys.prefix, 'bin', 'python-32')
18else:
19 sys.executable = os.path.join(sys.prefix, 'bin', 'python')
Thomas Wouters477c8d52006-05-27 19:21:47 +000020
21# Look for the -psn argument that the launcher adds and remove it, it will
22# only confuse the IDLE startup code.
23for idx, value in enumerate(sys.argv):
24 if value.startswith('-psn_'):
25 del sys.argv[idx]
26 break
27
28#argvemulator.ArgvCollector().mainloop()
29if __name__ == '__main__':
30 main()