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