diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-04-17 08:48:32 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-04-17 08:48:32 (GMT) |
commit | 9d72bb452bced3a100f07f8a9e30c4495a9ec41a (patch) | |
tree | c39762a764fcc16f2cfc42e2504e58ff31e159e6 /Lib/idlelib | |
parent | ff11334927ee616d765b54a3851016b76a20bcec (diff) | |
download | cpython-9d72bb452bced3a100f07f8a9e30c4495a9ec41a.zip cpython-9d72bb452bced3a100f07f8a9e30c4495a9ec41a.tar.gz cpython-9d72bb452bced3a100f07f8a9e30c4495a9ec41a.tar.bz2 |
Remove functions in string module that are also string methods. Also remove:
* all calls to functions in the string module (except maketrans)
* everything from stropmodule except for maketrans() which is still used
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/Debugger.py | 3 | ||||
-rw-r--r-- | Lib/idlelib/MultiCall.py | 3 | ||||
-rw-r--r-- | Lib/idlelib/aboutDialog.py | 4 | ||||
-rw-r--r-- | Lib/idlelib/configDialog.py | 8 | ||||
-rw-r--r-- | Lib/idlelib/configHandler.py | 3 | ||||
-rw-r--r-- | Lib/idlelib/keybindingDialog.py | 2 |
6 files changed, 10 insertions, 13 deletions
diff --git a/Lib/idlelib/Debugger.py b/Lib/idlelib/Debugger.py index f56460a..df691ed 100644 --- a/Lib/idlelib/Debugger.py +++ b/Lib/idlelib/Debugger.py @@ -348,8 +348,7 @@ class StackViewer(ScrolledList): funcname = code.co_name import linecache sourceline = linecache.getline(filename, lineno) - import string - sourceline = string.strip(sourceline) + sourceline = sourceline.strip() if funcname in ("?", "", None): item = "%s, line %d: %s" % (modname, lineno, sourceline) else: diff --git a/Lib/idlelib/MultiCall.py b/Lib/idlelib/MultiCall.py index 1bb1576..61730b8 100644 --- a/Lib/idlelib/MultiCall.py +++ b/Lib/idlelib/MultiCall.py @@ -31,7 +31,6 @@ Each function will be called at most once for each event. import sys import os -import string import re import Tkinter @@ -244,7 +243,7 @@ def _parse_sequence(sequence): """ if not sequence or sequence[0] != '<' or sequence[-1] != '>': return None - words = string.split(sequence[1:-1], '-') + words = '-'.split(sequence[1:-1]) modifiers = 0 while words and words[0] in _modifier_names: diff --git a/Lib/idlelib/aboutDialog.py b/Lib/idlelib/aboutDialog.py index c121061..afdafd2 100644 --- a/Lib/idlelib/aboutDialog.py +++ b/Lib/idlelib/aboutDialog.py @@ -3,7 +3,7 @@ """ from Tkinter import * -import string, os +import os import textView import idlever @@ -70,7 +70,7 @@ class AboutDialog(Toplevel): tkVer[len(tkVer)-1] = str('%.3g' % (float('.'+tkVer[len(tkVer)-1])))[2:] if tkVer[len(tkVer)-1] == '': tkVer[len(tkVer)-1] = '0' - tkVer = string.join(tkVer,'.') + tkVer = '.'.join(tkVer) labelTkVer = Label(frameBg, text='Tk version: '+ tkVer, fg=self.fg, bg=self.bg) labelTkVer.grid(row=9, column=1, sticky=W, padx=2, pady=0) diff --git a/Lib/idlelib/configDialog.py b/Lib/idlelib/configDialog.py index c1cbf82..eadb69d 100644 --- a/Lib/idlelib/configDialog.py +++ b/Lib/idlelib/configDialog.py @@ -11,7 +11,7 @@ Refer to comments in EditorWindow autoindent code for details. """ from Tkinter import * import tkMessageBox, tkColorChooser, tkFont -import string, copy +import copy from configHandler import idleConf from dynOptionMenuWidget import DynOptionMenu @@ -650,7 +650,7 @@ class ConfigDialog(Toplevel): newKeys={} for event in prevKeys.keys(): #add key set to changed items eventName=event[2:-2] #trim off the angle brackets - binding=string.join(prevKeys[event]) + binding=' '.join(prevKeys[event]) newKeys[eventName]=binding #handle any unsaved changes to prev key set if prevKeySetName in self.changedItems['keys'].keys(): @@ -677,7 +677,7 @@ class ConfigDialog(Toplevel): bindNames.sort() self.listBindings.delete(0,END) for bindName in bindNames: - key=string.join(keySet[bindName]) #make key(s) into a string + key=' '.join(keySet[bindName]) #make key(s) into a string bindName=bindName[2:-2] #trim off the angle brackets if keySetName in self.changedItems['keys'].keys(): #handle any unsaved changes to this key set @@ -914,7 +914,7 @@ class ConfigDialog(Toplevel): self.changedItems['main']['HelpFiles'] = {} for num in range(1,len(self.userHelpList)+1): self.AddChangedItem('main','HelpFiles',str(num), - string.join(self.userHelpList[num-1][:2],';')) + ';'.join(self.userHelpList[num-1][:2])) def LoadFontCfg(self): ##base editor font selection list diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/configHandler.py index 0a08de2..963cf95 100644 --- a/Lib/idlelib/configHandler.py +++ b/Lib/idlelib/configHandler.py @@ -19,7 +19,6 @@ configuration problem notification and resolution. """ import os import sys -import string import macosxSupport from ConfigParser import ConfigParser, NoOptionError, NoSectionError @@ -632,7 +631,7 @@ class IdleConf: menuItem='' #make these empty helpPath='' #so value won't be added to list else: #config entry contains ';' as expected - value=string.split(value,';') + value=value.split(';') menuItem=value[0].strip() helpPath=value[1].strip() if menuItem and helpPath: #neither are empty strings diff --git a/Lib/idlelib/keybindingDialog.py b/Lib/idlelib/keybindingDialog.py index 69900f9..16db557 100644 --- a/Lib/idlelib/keybindingDialog.py +++ b/Lib/idlelib/keybindingDialog.py @@ -163,7 +163,7 @@ class GetKeysDialog(Toplevel): if finalKey: finalKey = self.TranslateKey(finalKey, modifiers) keyList.append(finalKey) - self.keyString.set('<' + string.join(keyList,'-') + '>') + self.keyString.set('<' + '-'.join(keyList) + '>') def GetModifiers(self): modList = [variable.get() for variable in self.modifier_vars] |