summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2006-08-22 15:45:46 (GMT)
committerGuido van Rossum <guido@python.org>2006-08-22 15:45:46 (GMT)
commit811c4e0b7cb1a3b43cda8dab0b1587983b44c58d (patch)
tree6d1172a99c68bba0391eb165c2ddcc75315b56ad
parentd204a715f4776fc2e5498e81c9e7a647e902b682 (diff)
downloadcpython-811c4e0b7cb1a3b43cda8dab0b1587983b44c58d.zip
cpython-811c4e0b7cb1a3b43cda8dab0b1587983b44c58d.tar.gz
cpython-811c4e0b7cb1a3b43cda8dab0b1587983b44c58d.tar.bz2
Remove has_key() references from idlelib. IDLE still doesn't run due
to relative import issues. Any volunteers?
-rw-r--r--Lib/idlelib/EditorWindow.py4
-rw-r--r--Lib/idlelib/FileList.py4
-rw-r--r--Lib/idlelib/MultiCall.py2
-rw-r--r--Lib/idlelib/MultiStatusBar.py2
-rw-r--r--Lib/idlelib/ObjectBrowser.py2
-rw-r--r--Lib/idlelib/PathBrowser.py2
-rw-r--r--Lib/idlelib/RemoteDebugger.py2
-rw-r--r--Lib/idlelib/TreeWidget.py2
-rw-r--r--Lib/idlelib/WidgetRedirector.py4
-rw-r--r--Lib/idlelib/configDialog.py10
-rw-r--r--Lib/idlelib/rpc.py6
11 files changed, 20 insertions, 20 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index 6b8ab63..dccd3ff 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -648,8 +648,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 4b57901..2ef0640 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 1c6103a..40db92d 100644
--- a/Lib/idlelib/MultiCall.py
+++ b/Lib/idlelib/MultiCall.py
@@ -187,7 +187,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 74085c3..0422cce 100644
--- a/Lib/idlelib/RemoteDebugger.py
+++ b/Lib/idlelib/RemoteDebugger.py
@@ -231,7 +231,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 c5c171f..1d777df 100644
--- a/Lib/idlelib/TreeWidget.py
+++ b/Lib/idlelib/TreeWidget.py
@@ -410,7 +410,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/WidgetRedirector.py b/Lib/idlelib/WidgetRedirector.py
index df60cea..126a2cd 100644
--- a/Lib/idlelib/WidgetRedirector.py
+++ b/Lib/idlelib/WidgetRedirector.py
@@ -29,7 +29,7 @@ class WidgetRedirector:
tk.call("rename", orig, w)
def register(self, name, function):
- if self.dict.has_key(name):
+ if name in self.dict:
previous = dict[name]
else:
previous = OriginalCommand(self, name)
@@ -38,7 +38,7 @@ class WidgetRedirector:
return previous
def unregister(self, name):
- if self.dict.has_key(name):
+ if name in self.dict:
function = self.dict[name]
del self.dict[name]
if hasattr(self.widget, name):
diff --git a/Lib/idlelib/configDialog.py b/Lib/idlelib/configDialog.py
index 2d8835c..c1cbf82 100644
--- a/Lib/idlelib/configDialog.py
+++ b/Lib/idlelib/configDialog.py
@@ -550,7 +550,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
@@ -697,7 +697,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()
@@ -724,7 +724,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()
@@ -859,9 +859,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 3bac6a3..e3a42d9 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" %
@@ -552,7 +552,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