diff --git a/Mac/Include/pythonresources.h b/Mac/Include/pythonresources.h index 9f8b2c452a9..01c96ffec44 100644 --- a/Mac/Include/pythonresources.h +++ b/Mac/Include/pythonresources.h @@ -77,6 +77,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define OPT_NOSITE 14 #define OPT_HELP 15 #define OPT_NONAVSERV 16 +#define OPT_VERBOSEVERBOSE 19 +#define OPT_DIVISIONWARN 20 +#define OPT_UNIXNEWLINES 21 /* Dialog for 'No preferences directory' */ #define NOPREFDIR_ID BASE_ID+5 @@ -140,7 +143,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define PYTHONOPTIONS_ID 228 #define PYTHONOPTIONSOVERRIDE_ID 229 -#define POPT_VERSION_CURRENT 7 /* Current version number */ +#define POPT_VERSION_CURRENT 8 /* Current version number */ #define POPT_KEEPCONSOLE_NEVER 0 #define POPT_KEEPCONSOLE_OUTPUT 1 #define POPT_KEEPCONSOLE_ERROR 2 @@ -162,6 +165,8 @@ typedef struct PyMac_PrefRecord { unsigned char nosite; unsigned char nonavservice; unsigned char delayconsole; + unsigned char divisionwarn; + unsigned char unixnewlines; } PyMac_PrefRecord; #endif diff --git a/Mac/Lib/pythonprefs.py b/Mac/Lib/pythonprefs.py index 0ae3e36915b..da28d02e83c 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=7 +CUR_VERSION=8 preffilename = PstringLoader(AnyResLoader('STR ', resname=PREFNAME_NAME)).load() pref_fss = preferencefile(preffilename, 'Pyth', 'pref') class PoptLoader(VersionLoader): def __init__(self, loader): - VersionLoader.__init__(self, "bbbbbbbbbbbbbb", loader) + VersionLoader.__init__(self, "bbbbbbbbbbbbbbbb", loader) def versioncheck(self, data): if data[0] == CUR_VERSION: @@ -51,7 +51,7 @@ class GusiLoader: newdata = tp + cr + self.data[8:] self.loader.save(newdata) -popt_default_default = NullLoader(chr(CUR_VERSION) + 8*'\0') +popt_default_default = NullLoader(chr(CUR_VERSION) + 14*'\0' + '\001') popt_default = AnyResLoader('Popt', POPT_ID, default=popt_default_default) popt_loader = ResLoader(pref_fss, 'Popt', POPT_ID, default=popt_default) popt = PoptLoader(popt_loader) @@ -85,7 +85,8 @@ class PythonOptions: dict['version'], dict['inspect'], dict['verbose'], dict['optimize'], \ dict['unbuffered'], dict['debugging'], dummy, dict['keep_console'], \ dict['nointopt'], dict['noargs'], dict['tabwarn'], \ - dict['nosite'], dict['nonavservice'], dict['delayconsole'] = flags + dict['nosite'], dict['nonavservice'], dict['delayconsole'], \ + dict['divisionwarn'], dict['unixnewlines'] = flags return dict def save(self, dict): @@ -96,7 +97,8 @@ class PythonOptions: flags = dict['version'], dict['inspect'], dict['verbose'], dict['optimize'], \ dict['unbuffered'], dict['debugging'], 0, dict['keep_console'], \ dict['nointopt'], dict['noargs'], dict['tabwarn'], \ - dict['nosite'], dict['nonavservice'], dict['delayconsole'] + dict['nosite'], dict['nonavservice'], dict['delayconsole'], \ + dict['divisionwarn'], dict['unixnewlines'] self.popt.save(flags) def AppletOptions(file): diff --git a/Mac/Resources/dialogs.rsrc b/Mac/Resources/dialogs.rsrc index 1e219b26745..711bd5b26bc 100644 Binary files a/Mac/Resources/dialogs.rsrc and b/Mac/Resources/dialogs.rsrc differ diff --git a/Mac/Resources/pythonpath.r b/Mac/Resources/pythonpath.r index b116f596a8d..d599023d640 100644 --- a/Mac/Resources/pythonpath.r +++ b/Mac/Resources/pythonpath.r @@ -26,6 +26,8 @@ type 'Popt' { byte sitePython = 0, noSitePython = 1; byte navService = 0, noNavService = 1; byte noDelayConsole = 0, delayConsole = 1; + byte noDivisionWarning = 0, divisionWarning = 1; + byte noUnixNewlines = 0, unixNewlines = 1; }; type 'TMPL' { @@ -55,6 +57,8 @@ resource 'TMPL' (PYTHONOPTIONS_ID, "Popt") { "No site-python support", 'DBYT', "No NavServices in macfs", 'DBYT', "Delay console window", 'DBYT', + "Warnings for old-style division", 'DBYT', + "Allow unix newlines on textfile input",'DBYT', } }; @@ -75,6 +79,8 @@ resource 'Popt' (PYTHONOPTIONS_ID, "Options") { sitePython, navService, noDelayConsole, + noDivisionWarning, + unixNewlines, }; /* The sys.path initializer */ diff --git a/Mac/scripts/EditPythonPrefs.py b/Mac/scripts/EditPythonPrefs.py index 833e60789b3..d9a0c5d3e53 100644 --- a/Mac/scripts/EditPythonPrefs.py +++ b/Mac/scripts/EditPythonPrefs.py @@ -54,6 +54,8 @@ opt_dialog_map = [ "nointopt", "noargs", "delayconsole", + "divisionwarn", + "unixnewlines", ] opt_dialog_dict = {} for i in range(len(opt_dialog_map)): @@ -61,15 +63,15 @@ for i in range(len(opt_dialog_map)): opt_dialog_dict[opt_dialog_map[i]] = i # 1 thru 10 are the options # The GUSI creator/type and delay-console -OD_CREATOR_ITEM = 18 -OD_TYPE_ITEM = 19 +OD_CREATOR_ITEM = 20 +OD_TYPE_ITEM = 21 OD_OK_ITEM = 1 OD_CANCEL_ITEM = 2 -OD_HELP_ITEM = 20 -OD_KEEPALWAYS_ITEM = 14 -OD_KEEPOUTPUT_ITEM = 15 -OD_KEEPERROR_ITEM = 16 -OD_KEEPNEVER_ITEM = 17 +OD_HELP_ITEM = 22 +OD_KEEPALWAYS_ITEM = 16 +OD_KEEPOUTPUT_ITEM = 17 +OD_KEEPERROR_ITEM = 18 +OD_KEEPNEVER_ITEM = 19 def optinteract(options): """Let the user interact with the options dialog""" diff --git a/Mac/scripts/EditPythonPrefs.rsrc b/Mac/scripts/EditPythonPrefs.rsrc index fafc9083d6a..321ec4f4dd8 100644 Binary files a/Mac/scripts/EditPythonPrefs.rsrc and b/Mac/scripts/EditPythonPrefs.rsrc differ