Mercurial > cpython-lru_cache-weakref
comparison Mac/scripts/ConfigurePython.py @ 19488:42b2f1936254 legacy-trunk
Import the MacOS toolbox modules from the Carbon package.
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Sat, 25 Aug 2001 12:15:04 +0000 |
| parents | 59472bcbfb8e |
| children | 1e7c0b849584 |
comparison
equal
deleted
inserted
replaced
| 19487:3e68e1a02ad2 | 19488:42b2f1936254 |
|---|---|
| 11 import os | 11 import os |
| 12 import macfs | 12 import macfs |
| 13 import MacOS | 13 import MacOS |
| 14 import gestalt | 14 import gestalt |
| 15 import string | 15 import string |
| 16 import Res | 16 from Carbon import Res |
| 17 | 17 |
| 18 SPLASH_COPYCORE=512 | 18 SPLASH_COPYCORE=512 |
| 19 SPLASH_COPYCARBON=513 | 19 SPLASH_COPYCARBON=513 |
| 20 SPLASH_COPYCLASSIC=514 | 20 SPLASH_COPYCLASSIC=514 |
| 21 SPLASH_BUILDAPPLETS=515 | 21 SPLASH_BUILDAPPLETS=515 |
| 87 do_copy = 1 | 87 do_copy = 1 |
| 88 return do_copy | 88 return do_copy |
| 89 do_copy = 0 | 89 do_copy = 0 |
| 90 if macfs.FSSpec(sys.exec_prefix).as_tuple()[0] != -1: # XXXX | 90 if macfs.FSSpec(sys.exec_prefix).as_tuple()[0] != -1: # XXXX |
| 91 try: | 91 try: |
| 92 import Dlg | 92 from Carbon import Dlg |
| 93 rv = Dlg.CautionAlert(ALERT_NONBOOT, None) | 93 rv = Dlg.CautionAlert(ALERT_NONBOOT, None) |
| 94 if rv == ALERT_NONBOOT_COPY: | 94 if rv == ALERT_NONBOOT_COPY: |
| 95 do_copy = 1 | 95 do_copy = 1 |
| 96 except ImportError: | 96 except ImportError: |
| 97 pass | 97 pass |
| 139 if verbose: | 139 if verbose: |
| 140 print "Not running as applet: Skipping check for preference file correctness." | 140 print "Not running as applet: Skipping check for preference file correctness." |
| 141 elif oldcwd != newcwd: | 141 elif oldcwd != newcwd: |
| 142 # Hack to make sure we get the new MACFS | 142 # Hack to make sure we get the new MACFS |
| 143 sys.path.insert(0, os.path.join(oldcwd, ':Mac:Lib')) | 143 sys.path.insert(0, os.path.join(oldcwd, ':Mac:Lib')) |
| 144 import Dlg | 144 from Carbon import Dlg |
| 145 rv = Dlg.CautionAlert(ALERT_NOTPYTHONFOLDER, None) | 145 rv = Dlg.CautionAlert(ALERT_NOTPYTHONFOLDER, None) |
| 146 if rv == ALERT_NOTPYTHONFOLDER_REMOVE_QUIT: | 146 if rv == ALERT_NOTPYTHONFOLDER_REMOVE_QUIT: |
| 147 import pythonprefs, preferences | 147 import pythonprefs, preferences |
| 148 prefpathname = pythonprefs.pref_fss.as_pathname() | 148 prefpathname = pythonprefs.pref_fss.as_pathname() |
| 149 os.remove(prefpathname) | 149 os.remove(prefpathname) |
| 160 print "Copying PythonCore..." | 160 print "Copying PythonCore..." |
| 161 n = 0 | 161 n = 0 |
| 162 n = n + mkcorealias('PythonCore', 'PythonCore') | 162 n = n + mkcorealias('PythonCore', 'PythonCore') |
| 163 n = n + mkcorealias('PythonCoreCarbon', 'PythonCoreCarbon') | 163 n = n + mkcorealias('PythonCoreCarbon', 'PythonCoreCarbon') |
| 164 if n == 0: | 164 if n == 0: |
| 165 import Dlg | 165 from Carbon import Dlg |
| 166 Dlg.CautionAlert(ALERT_NOCORE, None) | 166 Dlg.CautionAlert(ALERT_NOCORE, None) |
| 167 if verbose: | 167 if verbose: |
| 168 print "Warning: PythonCore not copied to Extensions folder" | 168 print "Warning: PythonCore not copied to Extensions folder" |
| 169 if sys.argv[0][-7:] == 'Classic': | 169 if sys.argv[0][-7:] == 'Classic': |
| 170 do_classic = 1 | 170 do_classic = 1 |
