summaryrefslogtreecommitdiffstats
path: root/Mac/scripts
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-01-29 14:59:33 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-01-29 14:59:33 (GMT)
commit1bbf6ff00fec957d8f129af8ff8e60e16249b74b (patch)
treed22b0c5d2d6d18123642b322030ca035db23c302 /Mac/scripts
parenta3e2dcadcce5cd753e6fd69bde8bd8b61b72a054 (diff)
downloadcpython-1bbf6ff00fec957d8f129af8ff8e60e16249b74b.zip
cpython-1bbf6ff00fec957d8f129af8ff8e60e16249b74b.tar.gz
cpython-1bbf6ff00fec957d8f129af8ff8e60e16249b74b.tar.bz2
Make balloon code dependent on existence of Help module
Diffstat (limited to 'Mac/scripts')
-rw-r--r--Mac/scripts/EditPythonPrefs.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/Mac/scripts/EditPythonPrefs.py b/Mac/scripts/EditPythonPrefs.py
index 78da11b..a03ae78 100644
--- a/Mac/scripts/EditPythonPrefs.py
+++ b/Mac/scripts/EditPythonPrefs.py
@@ -16,7 +16,10 @@ import sys
import Res # For Res.Error
import pythonprefs
import EasyDialogs
-import Help
+try:
+ import Help
+except ImportError:
+ Help = None
# resource IDs in our own resources (dialogs, etc)
MESSAGE_ID = 256
@@ -76,6 +79,8 @@ def optinteract(options):
SetDialogItemText(htext, options['type'])
d.SetDialogDefaultItem(OD_OK_ITEM)
d.SetDialogCancelItem(OD_CANCEL_ITEM)
+ if not Help:
+ d.HideDialogItem(OD_HELP_ITEM)
while 1:
for name in opt_dialog_dict.keys():
num = opt_dialog_dict[name]
@@ -113,7 +118,7 @@ def optinteract(options):
options['keep_console'] = 2;
elif n == OD_KEEPNEVER_ITEM:
options['keep_console'] = 0;
- elif n == OD_HELP_ITEM:
+ elif n == OD_HELP_ITEM and Help:
onoff = Help.HMGetBalloons()
Help.HMSetBalloons(not onoff)
elif 1 <= n <= len(opt_dialog_map):
@@ -138,6 +143,8 @@ def interact(options, title):
d.SelectDialogItemText(TEXT_ITEM, 0, 0)
## d.SetDialogDefaultItem(OK_ITEM)
d.SetDialogCancelItem(CANCEL_ITEM)
+ if not Help:
+ d.HideDialogItem(HELP_ITEM)
d.GetDialogWindow().ShowWindow()
d.DrawDialog()
while 1:
@@ -152,7 +159,7 @@ def interact(options, title):
fss, ok = macfs.GetDirectory('Select python home folder:')
if ok:
options['dir'] = fss
- elif n == HELP_ITEM:
+ elif n == HELP_ITEM and Help:
onoff = Help.HMGetBalloons()
Help.HMSetBalloons(not onoff)
if n == OPTIONS_ITEM: