From 0c6d037cc5f53420d519f108eaa4a7cdd76379bf Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 5 May 2000 23:11:14 +0000 Subject: [PATCH] Removed string-exception preference, added tabcheck and NavService preference, upped version number. --- Mac/Lib/pythonprefs.py | 12 +++++----- Mac/Python/macmain.c | 36 ++++++++++++++++++++++++++--- Mac/Resources/balloons.bh | 4 +++- Mac/Resources/dialogs.rsrc | Bin 15704 -> 16202 bytes Mac/Resources/pythonpath.r | 3 +++ Mac/scripts/EditPythonPrefs.py | 6 +++-- Mac/scripts/EditPythonPrefs.rsrc | Bin 8553 -> 8809 bytes Mac/scripts/EditPythonPrefsBH.bh | 4 +++- Mac/scripts/EditPythonPrefsBH.prj | Bin 15310 -> 21084 bytes Mac/scripts/EditPythonPrefsBH.rsrc | Bin 3757 -> 3953 bytes 10 files changed, 52 insertions(+), 13 deletions(-) diff --git a/Mac/Lib/pythonprefs.py b/Mac/Lib/pythonprefs.py index 40a2dd21ff..916ec9f2b3 100644 --- a/Mac/Lib/pythonprefs.py +++ b/Mac/Lib/pythonprefs.py @@ -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): diff --git a/Mac/Python/macmain.c b/Mac/Python/macmain.c index 98298c8fcd..98c8323843 100644 --- a/Mac/Python/macmain.c +++ b/Mac/Python/macmain.c @@ -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))) { diff --git a/Mac/Resources/balloons.bh b/Mac/Resources/balloons.bh index ebd9e3c2e3..983af88b13 100644 --- a/Mac/Resources/balloons.bh +++ b/Mac/Resources/balloons.bh @@ -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. diff --git a/Mac/Resources/dialogs.rsrc b/Mac/Resources/dialogs.rsrc index d2551469735d93c20cdb6caede53aab8f6615151..ea1b10258b8efe2e688302ac1469653235f3c73b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G7^HgVq34WhE`2o+`XY#x2Kt5qWNGi2nhXb>P16I&2-36W(w%rA7D?9snMGdbSdt z0FAT4pRvF(Uxhznxxhic9f!v(1EI&lM1JNqVTE=AO*O(E>fnpr5%$t)phXi_DZwnm zk&pOGY2n2+{dARiNm!#9pjC00FBau}oR__Nq=RQ*E20n3jtj5jtPW+ja0vsfCmrVJ ztp=KZ2@~z-S%Sg}g_zrfJ=6r3=!-P%dJ;EsS12$cBb>Vlyio?w#!XAgiE5crf zTTcK5E~JVxF9$w{+q#AQ!tM<;hohXp@sey@6P8@#maya+cZDU_m=%^>aP$gLx}c2m4h^Y>T& ZcoXs3?N-9H#zysAMH-3kotuwO&>yVx-A@1j diff --git a/Mac/Resources/pythonpath.r b/Mac/Resources/pythonpath.r index 34c6d40480..415a435387 100644 --- a/Mac/Resources/pythonpath.r +++ b/Mac/Resources/pythonpath.r @@ -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 */ diff --git a/Mac/scripts/EditPythonPrefs.py b/Mac/scripts/EditPythonPrefs.py index 343ea222d4..618d33e4ec 100644 --- a/Mac/scripts/EditPythonPrefs.py +++ b/Mac/scripts/EditPythonPrefs.py @@ -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_d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q>y^3#M75y_TPRB|i?J%} z9|#*IkkQM_YE+saitv}}lr%$hk+;<7=^dKdh0dtB3a}4Ng#R7J;XAG%IvttI;*fe7 zSGcOpN$)_0ue_jzr+0|<;Kf6aZmpVYc0IUSv8`Z{S!TV;76zN`(;V{GTG$oH*rnN8 zyls4_-_=e9L^c&V0kPZ1qi_IT#7mA&>qBHBfg@Ou<7JZ-tESC2{PTQD8O4)4 zt(ZKcjPtk31OCM4=C^%q?+jeU$5?WnK%ke1Sc;6fc+9Wf6UOkr9;y8-8H_9iH{tkV zT2B!_H{$6qX>-{qERnuRM>ekA#22E^8|_Ie2#)JS1#E%=)(2nl}`rscc@*b{=S|{UL$?QCqs>7x7Py* z98xe~Pq6ClbKm#=82Y}af(IoZ2<^0by&xQ$7R>*I&Ytss5jcqP4@Ubj{$E2sK)V9C QGk0%UEXb@{b&VCRf8E}s1ONa4 diff --git a/Mac/scripts/EditPythonPrefsBH.bh b/Mac/scripts/EditPythonPrefsBH.bh index f2ce285128..c12f31d90b 100644 --- a/Mac/scripts/EditPythonPrefsBH.bh +++ b/Mac/scripts/EditPythonPrefsBH.bh @@ -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 diff --git a/Mac/scripts/EditPythonPrefsBH.prj b/Mac/scripts/EditPythonPrefsBH.prj index 4c3d719004ac6621268d1de58ce47cd2cf0db0ff..dcfa46746fad81348df0eba6505003d75a94d7c2 100644 GIT binary patch literal 21084 zcmeHPU2Ggz6~1Gy8hLc{HiTcPAum<=eoCADmoSSohg^w)Sq9=<(KV=YhEQ2cKBmwpRze_ z7u;fqb*vrFRWsG9TUg4wl{O;Nx#F{JEB%?!+V|9%)TvWwy--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