ยปCore Development>Code coverage>Mac/IDLE/idlemain.py

Python code coverage for Mac/IDLE/idlemain.py

#countcontent
1n/a"""
2n/aBootstrap script for IDLE as an application bundle.
3n/a"""
4n/aimport sys, os
5n/a
6n/afrom idlelib.PyShell import main
7n/a
8n/a# Change the current directory the user's home directory, that way we'll get
9n/a# a more useful default location in the open/save dialogs.
10n/aos.chdir(os.path.expanduser('~/Documents'))
11n/a
12n/a
13n/a# Make sure sys.executable points to the python interpreter inside the
14n/a# framework, instead of at the helper executable inside the application
15n/a# bundle (the latter works, but doesn't allow access to the window server)
16n/aif sys.executable.endswith('-32'):
17n/a sys.executable = os.path.join(sys.prefix, 'bin', 'python-32')
18n/aelse:
19n/a sys.executable = os.path.join(sys.prefix, 'bin', 'python')
20n/a
21n/a# Look for the -psn argument that the launcher adds and remove it, it will
22n/a# only confuse the IDLE startup code.
23n/afor idx, value in enumerate(sys.argv):
24n/a if value.startswith('-psn_'):
25n/a del sys.argv[idx]
26n/a break
27n/a
28n/a#argvemulator.ArgvCollector().mainloop()
29n/aif __name__ == '__main__':
30n/a main()