summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-09-01 22:36:29 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-09-01 22:36:29 (GMT)
commita5ffeb69ab814618d9b4d77eba3aa2e03b1b9625 (patch)
tree32e0aefa3cd84aa01e6f27b8f67bb6558a2c778c /Mac
parent822218b400d0f77636592e6786f9bb4f8fad6a43 (diff)
downloadcpython-a5ffeb69ab814618d9b4d77eba3aa2e03b1b9625.zip
cpython-a5ffeb69ab814618d9b4d77eba3aa2e03b1b9625.tar.gz
cpython-a5ffeb69ab814618d9b4d77eba3aa2e03b1b9625.tar.bz2
Added preferences/startup options for division warning
and accepting unix-style newlines on input.
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Include/pythonresources.h7
-rw-r--r--Mac/Lib/pythonprefs.py12
-rw-r--r--Mac/Resources/dialogs.rsrcbin18570 -> 19016 bytes
-rw-r--r--Mac/Resources/pythonpath.r6
-rw-r--r--Mac/scripts/EditPythonPrefs.py16
-rw-r--r--Mac/scripts/EditPythonPrefs.rsrcbin10118 -> 9692 bytes
6 files changed, 28 insertions, 13 deletions
diff --git a/Mac/Include/pythonresources.h b/Mac/Include/pythonresources.h
index 9f8b2c4..01c96ff 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 0ae3e36..da28d02 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 1e219b2..711bd5b 100644
--- a/Mac/Resources/dialogs.rsrc
+++ b/Mac/Resources/dialogs.rsrc
Binary files differ
diff --git a/Mac/Resources/pythonpath.r b/Mac/Resources/pythonpath.r
index b116f59..d599023 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 833e607..d9a0c5d 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 fafc908..321ec4f 100644
--- a/Mac/scripts/EditPythonPrefs.rsrc
+++ b/Mac/scripts/EditPythonPrefs.rsrc
Binary files differ