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 40a2dd21ffbc..916ec9f2b375 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 98298c8fcd6b..98c83238432e 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 ebd9e3c2e392..983af88b13bf 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..ea1b10258b8efe2e688302ac1469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=-}Co{tn z@GAF{L*^iS%1T;%dn&Px%x?P){8+1}+6!{PK0rMyhq|OeIVjB!vYvE2QWenj zS9+{vFG1;1XKs}qdw@uv^f(Jdm!-#7%v;jqJH8NAdMteBO|4^6VKLS%4s&s5M}xO0 zO}u3j)AFD`XwaSC1Yw)`kfZPL0XANBbip4Tb2c}PI_7K+uQ=vxZs`RIwmY$zbKKe7 z+U2+t>`b8A9PM?JL${pC1mAOWLl52DP|3{=JuB1acl84Flde;J+HDXXaT`QTw?SmS ztkAaGK+m{!!sp#Ok@7mFvN|HyYK-@({(kw#n~c}&H4}z8KBncQG#WoVI~Sj%|E%-f APXGV_ diff --git a/Mac/Resources/pythonpath.r b/Mac/Resources/pythonpath.r index 34c6d4048047..415a435387ad 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 343ea222d40f..618d33e4ec18 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_dialog_map[i]: diff --git a/Mac/scripts/EditPythonPrefs.rsrc b/Mac/scripts/EditPythonPrefs.rsrc index e8452c44a6ebdd926b88d3346b69cdc8e9badad8..83ccb5e3d796b6a291c8a414c3b6c7453ab514c5 100644 GIT binary patch delta 821 zc-l=;OH30%82)G3t+gP*fI?eZMjL#jC8@?hW7P0isMV&t3K+t{Wm#~gY?IwB!bReR zgC}*aghNlp7~{YQyVaevxqSj>Q7~>_<>%xh8KbM8O$6K*=6J$_`h?ihnE0b$~I} z5s0zAz!{EAT4|)7tptYHx4={OHc-_Pg$fqoH%6m1*0u(Sz%W@N8edDw*<>Fe>cI|s zaFRv6@7uPZ5sL6os7z(`87V`RIn{L9Z^1GYiCgd}x}MeTf}P+6Hwm+dFD$emyT-{O_6y78#${;LuAK&A=dx!#*)?IzRgyRS`H2RD3XL4QctMvt%_ zf6#@S-Q)zj>koxajYzsirSWXeq^c%oHA6K_MKfu-qm$+gX-Wb1+<$iA2<$*TA?;jY z&F=UDW7kQY&@5)PFD9;3XiAzLRP5*0)nc+Yj_rJ6BArCM*f($D;~+Qs5?yJ;;lcC(=8*9_6PYQjYw@8s3Dk=y=TJWp zlkr=K$Dd8e<~SDCR0lWNWjY_XUygUvmG_(@`xf{AL>?iwU;oj078Y;hUHR%y&iUOt z*0-=$Dp5Fk9{t;FkGA$V{IQoik=!9(br9pbf55#(SN_;i*$-NNb?-e*(W$N&*_jE) delta 663 zc-lpf!D|yi6vp3Mvbv@aDjL%!n@!SCq)7`A#MYuB%{E~%Bq5DfauAkeYXYmmNvh3B z5D%gv)u00RKmYviEa972Rftu3ity}gntg>@CBC<9a84PzE^OW zYk^t$H7M|j7Xsm_ZKB`s^qyO{R?Jnq9$cx|RZweU=5XppK1Di_ zZPa6Q+kDoD&*TXbOZglXVXj=VuhM}l$&2p|@;Aw@k-wv-l9x%J^NCO++3ocJ{CoX5 zdV)3AU?#zyjbZM61pk+^E8d+}uNQjbV-N+c5XX1iLb~u3Id~ KtXg%I6|KMB-lPNo diff --git a/Mac/scripts/EditPythonPrefsBH.bh b/Mac/scripts/EditPythonPrefsBH.bh index f2ce2851285d..c12f31d90b9c 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 zc-rk;Z)_aJ6`wty<3Dj+Cyo>2IG3%7xLAoCsRb1Lf!IF#94B|&$~LlvRLuFj^)1}q zF1veb0!SF~sp=>G3L#OcsA>>ZB&3#pK&ava{ebu*sz!jQ#FrL?)Jm-cA1W2O=fDkp~(CN@zT!}ZA15|FHY^eevo%mtp#+q_r} zD4mt`qOObbdPUR%s^p~V1A&EgOYqUo>CDNK(7LQj{<5tKU{ck9!DX^}Xu_vpVUaJW zh9pZ5`3lY#ONAvqFM@JG^;NOrQ%5N3rDCO7_pnBj{s}^+iFRpeh<0g}K<&~(VJ;g~ z5~z15oz~^RfiH>=u~DNG-ZZnEr2ENRQfgXBlS*(TG5o$V*Wlz`Y?Y9l6{ze4w8P%zYfU{F#ic816JPb?taWu`3Eph`#*^J zdm%Z9`HPSYVg6Z24q^UPNDgEEDkQ_0{|u6wtb7L@_Xy?zSI7~}pNC`=^AAFDbO*Zc zL>(SM{dJ?#lBl;{rYEx>BRDU8sHc9^%K++O6m>9&V;;gW4x_RTd)lXc^{%tY!+?tn)99 z*6Hb_<#r1&LWdhBE+^u}O&3afG0}~HF1%}SJzhuC2m~(g7gJ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cYqCQJ((;Nm5Rd4 F`xkrH{S^QJ diff --git a/Mac/scripts/EditPythonPrefsBH.rsrc b/Mac/scripts/EditPythonPrefsBH.rsrc index c2c864f1fdd64e4004966bbc347f95e51348c771..d272f638f14c3b06838c6937628b99dc4e4fce9e 100644 GIT binary patch delta 293 zc-mVl`%!L!jS)Y8P;iiQP_U~DBLgaEKropY7(lXodl?vb_fE`HnfRe};)l4&sf>>p zlQw%WDKkyZXHl5En^{O$8KgWTmq7)hk*knFW%Cr4u1jh$s@}xXl6>9F z+=Bd~5{QyKh4PHdVpi bGC^9(ixLY8Qj3ZwK9rnX!e_$j0dhY8q^4M7 delta 140 zc-s3Yw^nw7jR2o_P;iiQP_U~DBg20nnAj-6#mKJMJQXc5*ObhXfXb4L z{Jemo)U;wJ551z|qU53yM;8TO*Po#74=<7W^ixIv}M0$091i -- 2.47.3