diff options
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/EditorWindow.py | 4 | ||||
-rw-r--r-- | Lib/idlelib/FileList.py | 4 | ||||
-rw-r--r-- | Lib/idlelib/MultiCall.py | 2 | ||||
-rw-r--r-- | Lib/idlelib/MultiStatusBar.py | 2 | ||||
-rw-r--r-- | Lib/idlelib/ObjectBrowser.py | 2 | ||||
-rw-r--r-- | Lib/idlelib/PathBrowser.py | 2 | ||||
-rw-r--r-- | Lib/idlelib/RemoteDebugger.py | 2 | ||||
-rw-r--r-- | Lib/idlelib/TreeWidget.py | 2 | ||||
-rw-r--r-- | Lib/idlelib/configDialog.py | 10 | ||||
-rw-r--r-- | Lib/idlelib/rpc.py | 6 |
10 files changed, 18 insertions, 18 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index 5f6a885..d659cff 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -705,8 +705,8 @@ class EditorWindow(object): if accel: itemName = menu.entrycget(index, 'label') event = '' - if menuEventDict.has_key(menubarItem): - if menuEventDict[menubarItem].has_key(itemName): + if menubarItem in menuEventDict: + if itemName in menuEventDict[menubarItem]: event = menuEventDict[menubarItem][itemName] if event: accel = get_accelerator(keydefs, event) diff --git a/Lib/idlelib/FileList.py b/Lib/idlelib/FileList.py index e40c7a7..d69b0e3 100644 --- a/Lib/idlelib/FileList.py +++ b/Lib/idlelib/FileList.py @@ -25,7 +25,7 @@ class FileList: master=self.root) return None key = os.path.normcase(filename) - if self.dict.has_key(key): + if key in self.dict: edit = self.dict[key] edit.top.wakeup() return edit @@ -79,7 +79,7 @@ class FileList: newkey = os.path.normcase(filename) if newkey == key: return - if self.dict.has_key(newkey): + if newkey in self.dict: conflict = self.dict[newkey] self.inversedict[conflict] = None tkMessageBox.showerror( diff --git a/Lib/idlelib/MultiCall.py b/Lib/idlelib/MultiCall.py index b228f57..2cf931c 100644 --- a/Lib/idlelib/MultiCall.py +++ b/Lib/idlelib/MultiCall.py @@ -185,7 +185,7 @@ class _ComplexBinder: seq, handler))) def bind(self, triplet, func): - if not self.bindedfuncs.has_key(triplet[2]): + if triplet[2] not in self.bindedfuncs: self.bindedfuncs[triplet[2]] = [[] for s in _states] for s in _states: lists = [ self.bindedfuncs[detail][i] diff --git a/Lib/idlelib/MultiStatusBar.py b/Lib/idlelib/MultiStatusBar.py index 2d4c547..8ee2d03 100644 --- a/Lib/idlelib/MultiStatusBar.py +++ b/Lib/idlelib/MultiStatusBar.py @@ -9,7 +9,7 @@ class MultiStatusBar(Frame): self.labels = {} def set_label(self, name, text='', side=LEFT): - if not self.labels.has_key(name): + if name not in self.labels: label = Label(self, bd=1, relief=SUNKEN, anchor=W) label.pack(side=side) self.labels[name] = label diff --git a/Lib/idlelib/ObjectBrowser.py b/Lib/idlelib/ObjectBrowser.py index a2a6cee..b4f64b6 100644 --- a/Lib/idlelib/ObjectBrowser.py +++ b/Lib/idlelib/ObjectBrowser.py @@ -126,7 +126,7 @@ dispatch = { def make_objecttreeitem(labeltext, object, setfunction=None): t = type(object) - if dispatch.has_key(t): + if t in dispatch: c = dispatch[t] else: c = ObjectTreeItem diff --git a/Lib/idlelib/PathBrowser.py b/Lib/idlelib/PathBrowser.py index 86cd270..8c73587 100644 --- a/Lib/idlelib/PathBrowser.py +++ b/Lib/idlelib/PathBrowser.py @@ -78,7 +78,7 @@ class DirBrowserTreeItem(TreeItem): normed_name = os.path.normcase(name) if normed_name[i:] == suff: mod_name = name[:i] - if not modules.has_key(mod_name): + if mod_name not in modules: modules[mod_name] = None sorted.append((normed_name, name)) allnames.remove(name) diff --git a/Lib/idlelib/RemoteDebugger.py b/Lib/idlelib/RemoteDebugger.py index fa234d1..0b89168 100644 --- a/Lib/idlelib/RemoteDebugger.py +++ b/Lib/idlelib/RemoteDebugger.py @@ -230,7 +230,7 @@ class FrameProxy: return self._get_dict_proxy(did) def _get_dict_proxy(self, did): - if self._dictcache.has_key(did): + if did in self._dictcache: return self._dictcache[did] dp = DictProxy(self._conn, self._oid, did) self._dictcache[did] = dp diff --git a/Lib/idlelib/TreeWidget.py b/Lib/idlelib/TreeWidget.py index 5299e0e..842f788 100644 --- a/Lib/idlelib/TreeWidget.py +++ b/Lib/idlelib/TreeWidget.py @@ -409,7 +409,7 @@ class FileTreeItem(TreeItem): class ScrolledCanvas: def __init__(self, master, **opts): - if not opts.has_key('yscrollincrement'): + if 'yscrollincrement' not in opts: opts['yscrollincrement'] = 17 self.master = master self.frame = Frame(master) diff --git a/Lib/idlelib/configDialog.py b/Lib/idlelib/configDialog.py index 2f199a0..80c54b6 100644 --- a/Lib/idlelib/configDialog.py +++ b/Lib/idlelib/configDialog.py @@ -562,7 +562,7 @@ class ConfigDialog(Toplevel): def AddChangedItem(self,type,section,item,value): value=str(value) #make sure we use a string - if not self.changedItems[type].has_key(section): + if section not in self.changedItems[type]: self.changedItems[type][section]={} self.changedItems[type][section][item]=value @@ -709,7 +709,7 @@ class ConfigDialog(Toplevel): return #remove key set from config idleConf.userCfg['keys'].remove_section(keySetName) - if self.changedItems['keys'].has_key(keySetName): + if keySetName in self.changedItems['keys']: del(self.changedItems['keys'][keySetName]) #write changes idleConf.userCfg['keys'].Save() @@ -736,7 +736,7 @@ class ConfigDialog(Toplevel): return #remove theme from config idleConf.userCfg['highlight'].remove_section(themeName) - if self.changedItems['highlight'].has_key(themeName): + if themeName in self.changedItems['highlight']: del(self.changedItems['highlight'][themeName]) #write changes idleConf.userCfg['highlight'].Save() @@ -871,9 +871,9 @@ class ConfigDialog(Toplevel): #handle any unsaved changes to this theme if theme in self.changedItems['highlight'].keys(): themeDict=self.changedItems['highlight'][theme] - if themeDict.has_key(element+'-foreground'): + if element+'-foreground' in themeDict: colours['foreground']=themeDict[element+'-foreground'] - if themeDict.has_key(element+'-background'): + if element+'-background' in themeDict: colours['background']=themeDict[element+'-background'] self.textHighlightSample.tag_config(element, **colours) self.SetColourSample() diff --git a/Lib/idlelib/rpc.py b/Lib/idlelib/rpc.py index b3b786d..1395058 100644 --- a/Lib/idlelib/rpc.py +++ b/Lib/idlelib/rpc.py @@ -169,7 +169,7 @@ class SocketIO(object): how, (oid, methodname, args, kwargs) = request except TypeError: return ("ERROR", "Bad request format") - if not self.objtable.has_key(oid): + if oid not in self.objtable: return ("ERROR", "Unknown object id: %r" % (oid,)) obj = self.objtable[oid] if methodname == "__methods__": @@ -304,7 +304,7 @@ class SocketIO(object): # wait for notification from socket handling thread cvar = self.cvars[myseq] cvar.acquire() - while not self.responses.has_key(myseq): + while myseq not in self.responses: cvar.wait() response = self.responses[myseq] self.debug("_getresponse:%s: thread woke up: response: %s" % @@ -550,7 +550,7 @@ class RPCProxy(object): return MethodProxy(self.sockio, self.oid, name) if self.__attributes is None: self.__getattributes() - if self.__attributes.has_key(name): + if name in self.__attributes: value = self.sockio.remotecall(self.oid, '__getattribute__', (name,), {}) return value |