]> granicus.if.org Git - python/commitdiff
Removed string-exception preference, added tabcheck and NavService preference, upped...
authorJack Jansen <jack.jansen@cwi.nl>
Fri, 5 May 2000 23:11:14 +0000 (23:11 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Fri, 5 May 2000 23:11:14 +0000 (23:11 +0000)
Mac/Lib/pythonprefs.py
Mac/Python/macmain.c
Mac/Resources/balloons.bh
Mac/Resources/dialogs.rsrc
Mac/Resources/pythonpath.r
Mac/scripts/EditPythonPrefs.py
Mac/scripts/EditPythonPrefs.rsrc
Mac/scripts/EditPythonPrefsBH.bh
Mac/scripts/EditPythonPrefsBH.prj
Mac/scripts/EditPythonPrefsBH.rsrc

index 40a2dd21ffbc2c7b672d8ef32cc5aba65f0b97e6..916ec9f2b3755b08eac5049c8ffbea141afaa448 100644 (file)
@@ -16,14 +16,14 @@ OVERRIDE_POPT_ID = 229
 OVERRIDE_GUSI_ID = 10241
 
 # version
-CUR_VERSION=4
+CUR_VERSION=5
 
 preffilename = PstringLoader(AnyResLoader('STR ', resname=PREFNAME_NAME)).load()
 pref_fss = preferencefile(preffilename, 'Pyth', 'pref')
 
 class PoptLoader(VersionLoader):
        def __init__(self, loader):
-               VersionLoader.__init__(self, "bbbbbbbbbbbb", loader)
+               VersionLoader.__init__(self, "bbbbbbbbbbbbb", loader)
                
        def versioncheck(self, data):
                if data[0] == CUR_VERSION:
@@ -89,8 +89,8 @@ class PythonOptions:
                flags = self.popt.load()
                dict['version'], dict['inspect'], dict['verbose'], dict['optimize'], \
                        dict['unbuffered'], dict['debugging'], dict['keepopen'], dict['keeperror'], \
-                       dict['nointopt'], dict['noargs'], dict['oldexc'], \
-                       dict['nosite'] = flags
+                       dict['nointopt'], dict['noargs'], dict['tabwarn'], \
+                       dict['nosite'], dict['nonavservice'] = flags
                return dict
                
        def save(self, dict):
@@ -100,8 +100,8 @@ class PythonOptions:
                self.gusi.save((dict['creator'], dict['type'], dict['delayconsole']))
                flags = dict['version'], dict['inspect'], dict['verbose'], dict['optimize'], \
                        dict['unbuffered'], dict['debugging'], dict['keepopen'], dict['keeperror'], \
-                       dict['nointopt'], dict['noargs'], dict['oldexc'], \
-                       dict['nosite']
+                       dict['nointopt'], dict['noargs'], dict['tabwarn'], \
+                       dict['nosite'], dict['nonavservice']
                self.popt.save(flags)
 
 def AppletOptions(file):
index 98298c8fcd6b541afb357ea72bf0fc2fe264bce8..98c83238432ee52250488ccd7efd7927435d4c89 100644 (file)
@@ -149,8 +149,9 @@ PyMac_InteractiveOptions(PyMac_PrefRecord *p, int *argcp, char ***argvp)
        SET_OPT_ITEM(OPT_DEBUGGING, debugging);
        SET_OPT_ITEM(OPT_KEEPNORMAL, keep_normal);
        SET_OPT_ITEM(OPT_KEEPERROR, keep_error);
-       SET_OPT_ITEM(OPT_OLDEXC, oldexc);
+       SET_OPT_ITEM(OPT_TABWARN, tabwarn);
        SET_OPT_ITEM(OPT_NOSITE, nosite);
+       SET_OPT_ITEM(OPT_NONAVSERV, nonavservice);
        /* The rest are not settable interactively */
 
 #undef SET_OPT_ITEM
@@ -199,8 +200,9 @@ PyMac_InteractiveOptions(PyMac_PrefRecord *p, int *argcp, char ***argvp)
                OPT_ITEM(OPT_DEBUGGING, debugging);
                OPT_ITEM(OPT_KEEPNORMAL, keep_normal);
                OPT_ITEM(OPT_KEEPERROR, keep_error);
-               OPT_ITEM(OPT_OLDEXC, oldexc);
+               OPT_ITEM(OPT_TABWARN, tabwarn);
                OPT_ITEM(OPT_NOSITE, nosite);
+               OPT_ITEM(OPT_NONAVSERV, nonavservice);
                
 #undef OPT_ITEM
        }
@@ -266,7 +268,7 @@ init_common(int *argcp, char ***argvp, int embedded)
        Py_OptimizeFlag = options.optimize;
        Py_DebugFlag = options.debugging;
        Py_NoSiteFlag = options.nosite;
-       Py_UseClassExceptionsFlag = !(options.oldexc);
+       Py_TabcheckFlag = options.tabwarn;
        if ( options.noargs ) {
                /* don't process events at all without the scripts permission */
                PyMacSchedParams scp;
@@ -313,6 +315,30 @@ run_inspect()
        return sts;
 }
 
+/*
+** Import the macfsn module, which will override the Standard File
+** calls in the macfs builtin module by Navigation Services versions,
+** if available on this machine.
+*/
+static void
+PyMac_InstallNavServicesForSF()
+{
+       if ( !options.nonavservice ) {
+               PyObject *m = PyImport_ImportModule("macfsn");
+               
+               if ( m == NULL ) {
+                       PySys_WriteStderr("'import macfsn' failed; ");
+                       if (Py_VerboseFlag) {
+                               PySys_WriteStderr("traceback:\n");
+                               PyErr_Print();
+                       }
+                       else {
+                               PySys_WriteStderr("use -v for traceback\n");
+                       }
+               }
+       }
+}
+
 #ifdef USE_MAC_APPLET_SUPPORT
 /* Applet support */
 
@@ -360,6 +386,7 @@ PyMac_InitApplet()
        init_common(&argc, &argv, 0);
        
        Py_Initialize();
+       PyMac_InstallNavServicesForSF();
        PySys_SetArgv(argc, argv);
        
        err = run_main_resource();
@@ -383,6 +410,7 @@ PyMac_Initialize()
        
        init_common(&argc, &argv, 1);
        Py_Initialize();
+       PyMac_InstallNavServicesForSF();
        PySys_SetArgv(argc, argv);
 }
 
@@ -448,6 +476,8 @@ Py_Main(argc, argv)
        
        Py_Initialize();
        
+       PyMac_InstallNavServicesForSF();
+
        PySys_SetArgv(argc-1, argv+1);
 
        if (filename == NULL && isatty((int)fileno(fp))) {
index ebd9e3c2e392d437629dd42b6214be965559e078..983af88b13bf05de60c24ad8e5902043f5449ced 100644 (file)
@@ -20,7 +20,9 @@ DIALOG 231 Options
 13.3 Deselect to use new class-based standard exceptions.
 14.1 Selecting this disables the new package and site-python features.
 14.3 Deselecting this enables the new package and site-python features.
-16.1 Turn off balloon help.
+15.1 Turn off balloon help.
+16.1 Select this to keep the old behaviour for macfs Standard File calls
+16.3 Deselect this to auto-import macfsn which replaces macfs Standard File calls with Navigation Services wrappers
 END-DIALOG
 DIALOG 234
 1.1 Deleting the incorrect preference will not always work, but Python will run with standard options. 
index d2551469735d93c20cdb6caede53aab8f6615151..ea1b10258b8efe2e688302ac1469653235f3c73b 100644 (file)
Binary files a/Mac/Resources/dialogs.rsrc and b/Mac/Resources/dialogs.rsrc differ
index 34c6d4048047e87eeb666f9f1f7609ef340c512f..415a435387adb9b6a496ac62f5d1a436da7eb29b 100644 (file)
@@ -21,6 +21,7 @@ type 'Popt' {
        byte argcArgv = 0, noArgcArgv = 1;
        byte newStandardExceptions = 0, oldStandardExceptions = 1;
        byte sitePython = 0, noSitePython = 1;
+       byte navService = 0, noNavService = 1;
 };
 
 type 'TMPL' {
@@ -48,6 +49,7 @@ resource 'TMPL' (PYTHONOPTIONS_ID, "Popt") {
                "No argc/argv emulation",               'DBYT',
                "Old standard exceptions",              'DBYT',
                "No site-python support",               'DBYT',
+               "No NavServices in macfs",              'DBYT',
        }
 };
 
@@ -66,6 +68,7 @@ resource 'Popt' (PYTHONOPTIONS_ID, "Options") {
        argcArgv,
        newStandardExceptions,
        sitePython,
+       navService,
 };
 
 /* The sys.path initializer */
index 343ea222d40f14bab226bff2bb629b0a3bb3c4c2..618d33e4ec184ab10ecdd72a24b1e6aa79a48f1c 100644 (file)
@@ -48,8 +48,10 @@ opt_dialog_map = [
        "noargs",
        "delayconsole",
        None, None, None, None, None, None, None, None, # 11-18 are different
-       "oldexc",
-       "nosite"]
+       "tabwarn",
+       "nosite",
+       None,
+       "nonavservices"]
 opt_dialog_dict = {}
 for i in range(len(opt_dialog_map)):
        if opt_dialog_map[i]:
index e8452c44a6ebdd926b88d3346b69cdc8e9badad8..83ccb5e3d796b6a291c8a414c3b6c7453ab514c5 100644 (file)
Binary files a/Mac/scripts/EditPythonPrefs.rsrc and b/Mac/scripts/EditPythonPrefs.rsrc differ
index f2ce2851285d358ce43d6e55ba77447f42e1db3a..c12f31d90b9c8e78c8a7cc14cc0bcbf7036c03a3 100644 (file)
@@ -36,6 +36,8 @@ DIALOG 510
 19.3 Deselect to use new class-based standard exceptions.
 20.1 Selecting this disables the new package and site-python features.
 20.3 Deselecting this enables the new package and site-python features.
-22.1 Press here to turn help balloons off again.
+21.1 Press here to turn help balloons off again.
+22.1 Select this to use old-style Standard File calls in macfs
+22.3 Deselect this to auto-import macfsn which replaces macfs StandardFile calls with Navigation Services wrappers
 END-DIALOG
 END
index 4c3d719004ac6621268d1de58ce47cd2cf0db0ff..dcfa46746fad81348df0eba6505003d75a94d7c2 100644 (file)
Binary files a/Mac/scripts/EditPythonPrefsBH.prj and b/Mac/scripts/EditPythonPrefsBH.prj differ
index c2c864f1fdd64e4004966bbc347f95e51348c771..d272f638f14c3b06838c6937628b99dc4e4fce9e 100644 (file)
Binary files a/Mac/scripts/EditPythonPrefsBH.rsrc and b/Mac/scripts/EditPythonPrefsBH.rsrc differ