dabo Commit
Revision 1274
Date: 2005-09-08 22:45:48 -0700 (Thu, 08 Sep 2005)
Author: paul

Changed:
U   trunk/dabo/ui/uiwx/dPemMixin.py

Log:
Ed, I reverted the changes you made to dPemMixin regarding the
name setting: something is causing my processor to go to 100% 
and hang because of this - you didn't see that on your Mac? 



Diff:
Modified: trunk/dabo/ui/uiwx/dPemMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dPemMixin.py     2005-09-09 05:07:51 UTC (rev 1273)
+++ trunk/dabo/ui/uiwx/dPemMixin.py     2005-09-09 05:45:48 UTC (rev 1274)
@@ -1079,10 +1079,6 @@
                                        # Parent could be None, or currentName 
wasn't bound yet (init)
                                        pass
        
-                               # Make sure that the name isn't already used
-                               if self.Parent:
-                                       if hasattr(self.Parent, name):
-                                               raise NameError, "Name '%s' is 
already in use." % name
                                try:
                                        self.Parent.__dict__[name] = self
                                except AttributeError:
@@ -1097,16 +1093,16 @@
                                        # the name if necessary to make it 
unique (we don't want a NameError).
                                        i = 0
                                        while True:
+                                               nameError = False
                                                if i == 0:
                                                        candidate = name
                                                else:
                                                        candidate = "%s%s" % 
(name, i)
-                                               nameError = hasattr(parent, 
name)
-                                               if not nameError:
-                                                       for window in 
parent.GetChildren():
-                                                               if 
window.GetName() == candidate and window != self:
-                                                                       
nameError = True
-                                                                       break
+       
+                                               for window in 
parent.GetChildren():
+                                                       if window.GetName() == 
candidate and window != self:
+                                                               nameError = True
+                                                               break
                                                if nameError:
                                                        i += 1
                                                else:
@@ -1115,12 +1111,9 @@
                                else:
                                        # the user is explicitly setting the 
Name. If another object already
                                        # has the name, we must raise an 
exception immediately.
-                                       if hasattr(parent, name):
-                                               raise NameError, "Name '%s' is 
already in use." % name
-                                       else:
-                                               for window in 
parent.GetChildren():
-                                                       if 
str(window.GetName()) == str(name) and window != self:
-                                                               raise 
NameError, "Name '%s' is already in use." % name
+                                       for window in parent.GetChildren():
+                                               if str(window.GetName()) == 
str(name) and window != self:
+                                                       raise NameError, "Name 
'%s' is already in use." % name
                                        
                        else:
                                # Can't do the name check for siblings, so 
allow it for now.




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to