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:
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):
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):
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
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
}
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;
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 */
init_common(&argc, &argv, 0);
Py_Initialize();
+ PyMac_InstallNavServicesForSF();
PySys_SetArgv(argc, argv);
err = run_main_resource();
init_common(&argc, &argv, 1);
Py_Initialize();
+ PyMac_InstallNavServicesForSF();
PySys_SetArgv(argc, argv);
}
Py_Initialize();
+ PyMac_InstallNavServicesForSF();
+
PySys_SetArgv(argc-1, argv+1);
if (filename == NULL && isatty((int)fileno(fp))) {
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.
byte argcArgv = 0, noArgcArgv = 1;
byte newStandardExceptions = 0, oldStandardExceptions = 1;
byte sitePython = 0, noSitePython = 1;
+ byte navService = 0, noNavService = 1;
};
type 'TMPL' {
"No argc/argv emulation", 'DBYT',
"Old standard exceptions", 'DBYT',
"No site-python support", 'DBYT',
+ "No NavServices in macfs", 'DBYT',
}
};
argcArgv,
newStandardExceptions,
sitePython,
+ navService,
};
/* The sys.path initializer */
"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]:
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