commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue/common/src GObjects.py


From: Jason Cater
Subject: gnue/common/src GObjects.py
Date: Fri, 25 Jan 2002 22:18:11 -0500

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/01/25 22:18:11

Modified files:
        common/src     : GObjects.py 

Log message:
        modified walk function so that arbitrary arguments can be passed to the 
'walking' methods

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/GObjects.py.diff?cvsroot=OldCVS&tr1=1.23&tr2=1.24&r1=text&r2=text

Patches:
Index: gnue/common/src/GObjects.py
diff -c gnue/common/src/GObjects.py:1.23 gnue/common/src/GObjects.py:1.24
*** gnue/common/src/GObjects.py:1.23    Wed Jan 23 23:30:40 2002
--- gnue/common/src/GObjects.py Fri Jan 25 22:18:11 2002
***************
*** 204,215 ****
      return xmlString
  
  
!   def walk(self, function):
!     function(self)
      if self._children:
        for child in self._children:
          if isinstance(child, GObj):
!           child.walk(function)
  
    #
    # findParentOfType
--- 204,215 ----
      return xmlString
  
  
!   def walk(self, function, *args, **parms):
!     function(self, *args, **parms)
      if self._children:
        for child in self._children:
          if isinstance(child, GObj):
!           child.walk(function, *args, **parms)
  
    #
    # findParentOfType
***************
*** 222,230 ****
      while (parentObject._parent != None and parentObject.getObjectType() != 
type):
        parentObject = parentObject._parent
  
!     if parentObject.getObjectType() == type: 
        return parentObject
!     else: 
        return None
  
    #
--- 222,230 ----
      while (parentObject._parent != None and parentObject.getObjectType() != 
type):
        parentObject = parentObject._parent
  
!     if parentObject.getObjectType() == type:
        return parentObject
!     else:
        return None
  
    #
***************
*** 233,243 ****
    # Return a useful description of this object
    # Used by designer clients
    #
!   def getDescription(self): 
!     if hasattr(self,'_description'): 
        return self._description
!     elif hasattr(self,'name'): 
        return self.name + " (%s)" % self.getObjectType()[2:]
!     else: 
        return self._type[2:] + " (%s)" % self.getObjectType()[2:]
  
--- 233,243 ----
    # Return a useful description of this object
    # Used by designer clients
    #
!   def getDescription(self):
!     if hasattr(self,'_description'):
        return self._description
!     elif hasattr(self,'name'):
        return self.name + " (%s)" % self.getObjectType()[2:]
!     else:
        return self._type[2:] + " (%s)" % self.getObjectType()[2:]
  



reply via email to

[Prev in Thread] Current Thread [Next in Thread]