Browse Source

changed to has_key()

Dave Schuyler 22 years ago
parent
commit
e6f847c64b
2 changed files with 5 additions and 5 deletions
  1. 4 4
      direct/src/distributed/ParentMgr.py
  2. 1 1
      direct/src/gui/DirectGuiBase.py

+ 4 - 4
direct/src/distributed/ParentMgr.py

@@ -37,7 +37,7 @@ class ParentMgr:
         del self.pendingChildren
         del self.pendingChildren
 
 
     def requestReparent(self, child, parentToken):
     def requestReparent(self, child, parentToken):
-        if parentToken in self.token2nodepath.keys():
+        if self.token2nodepath.has_key(parentToken):
             # this parent has registered
             # this parent has registered
             self.notify.debug("performing wrtReparent of %s to '%s'" %
             self.notify.debug("performing wrtReparent of %s to '%s'" %
                               (repr(child), parentToken))
                               (repr(child), parentToken))
@@ -51,7 +51,7 @@ class ParentMgr:
             self.pendingChildren[parentToken].append(child)
             self.pendingChildren[parentToken].append(child)
             
             
     def registerParent(self, token, parent):
     def registerParent(self, token, parent):
-        if token in self.token2nodepath.keys():
+        if self.token2nodepath.has_key(token):
             self.notify.error(
             self.notify.error(
                 "token '%s' already in the table, referencing %s" %
                 "token '%s' already in the table, referencing %s" %
                 (token, repr(self.token2nodepath[token])))
                 (token, repr(self.token2nodepath[token])))
@@ -60,7 +60,7 @@ class ParentMgr:
         self.token2nodepath[token] = parent
         self.token2nodepath[token] = parent
 
 
         # if we have any pending children, add them
         # if we have any pending children, add them
-        if token in self.pendingChildren.keys():
+        if self.pendingChildren.has_key(token):
             children = self.pendingChildren[token]
             children = self.pendingChildren[token]
             for child in children:
             for child in children:
                 # NOTE: We do a plain-old reparentTo here (non-wrt)
                 # NOTE: We do a plain-old reparentTo here (non-wrt)
@@ -93,7 +93,7 @@ class ParentMgr:
             del self.pendingChildren[token]
             del self.pendingChildren[token]
 
 
     def unregisterParent(self, token):
     def unregisterParent(self, token):
-        if token not in self.token2nodepath.keys():
+        if not self.token2nodepath.has_key(token):
             self.notify.warning("unknown token '%s'" % token)
             self.notify.warning("unknown token '%s'" % token)
             return
             return
         self.notify.debug("unregistering parent '%s'" % (token))
         self.notify.debug("unregistering parent '%s'" % (token))

+ 1 - 1
direct/src/gui/DirectGuiBase.py

@@ -606,7 +606,7 @@ class DirectGuiBase(PandaObject.PandaObject):
         return names
         return names
 
 
     def hascomponent(self, component):
     def hascomponent(self, component):
-        return component in self.__componentInfo.keys()
+        return self.__componentInfo.has_key(component)
 
 
     def destroycomponent(self, name):
     def destroycomponent(self, name):
         # Remove a megawidget component.
         # Remove a megawidget component.