diff options
| author | Georg Brandl <georg@python.org> | 2006-06-09 20:43:48 (GMT) |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2006-06-09 20:43:48 (GMT) |
| commit | b2afe855e5d75a570707d6bf0e32206e4b7b1c4d (patch) | |
| tree | b637a7e78de40cf155c471e702e9b465fcd0625d /Lib/idlelib | |
| parent | 3ebef999e60cc63baafcdcfa0fd05c063715a66c (diff) | |
| download | cpython-b2afe855e5d75a570707d6bf0e32206e4b7b1c4d.zip cpython-b2afe855e5d75a570707d6bf0e32206e4b7b1c4d.tar.gz cpython-b2afe855e5d75a570707d6bf0e32206e4b7b1c4d.tar.bz2 | |
Make use of new str.startswith/endswith semantics.
Occurences in email and compiler were ignored due to backwards compat requirements.
Diffstat (limited to 'Lib/idlelib')
| -rw-r--r-- | Lib/idlelib/EditorWindow.py | 2 | ||||
| -rw-r--r-- | Lib/idlelib/configHandler.py | 2 | ||||
| -rw-r--r-- | Lib/idlelib/configHelpSourceEdit.py | 5 |
3 files changed, 4 insertions, 5 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index 59440f0..7604293 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -649,7 +649,7 @@ class EditorWindow(object): def __extra_help_callback(self, helpfile): "Create a callback with the helpfile value frozen at definition time" def display_extra_help(helpfile=helpfile): - if not (helpfile.startswith('www') or helpfile.startswith('http')): + if not helpfile.startswith(('www', 'http')): url = os.path.normpath(helpfile) if sys.platform[:3] == 'win': os.startfile(helpfile) diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/configHandler.py index 191a87c..dcd9321 100644 --- a/Lib/idlelib/configHandler.py +++ b/Lib/idlelib/configHandler.py @@ -406,7 +406,7 @@ class IdleConf: names=extnNameList kbNameIndicies=[] for name in names: - if name.endswith('_bindings') or name.endswith('_cfgBindings'): + if name.endswith(('_bindings', '_cfgBindings')): kbNameIndicies.append(names.index(name)) kbNameIndicies.sort() kbNameIndicies.reverse() diff --git a/Lib/idlelib/configHelpSourceEdit.py b/Lib/idlelib/configHelpSourceEdit.py index 8924f79..6611621 100644 --- a/Lib/idlelib/configHelpSourceEdit.py +++ b/Lib/idlelib/configHelpSourceEdit.py @@ -127,7 +127,7 @@ class GetHelpSourceDialog(Toplevel): parent=self) self.entryPath.focus_set() pathOk = False - elif path.startswith('www.') or path.startswith('http'): + elif path.startswith(('www.', 'http')): pass else: if path[:5] == 'file:': @@ -146,8 +146,7 @@ class GetHelpSourceDialog(Toplevel): self.path.get().strip()) if sys.platform == 'darwin': path = self.result[1] - if (path.startswith('www') or path.startswith('file:') - or path.startswith('http:')): + if path.startswith(('www', 'file:', 'http:')): pass else: # Mac Safari insists on using the URI form for local files |
