Changeset 758 for trunk

Show
Ignore:
Timestamp:
05/10/04 13:32:03 (5 years ago)
Author:
sholloway
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/RBFoundation/RBFoundation/XMLNode.py

    r755 r758  
    4848    def __ne__(self, other): 
    4949        return not self.__eq__(other) 
     50    def __repr__(self): 
     51        return "*" 
    5052_any = matchall() 
    5153 
     
    345347        """Returns a generator to iterate through the matching child node indicies of xmlnode. 
    346348        obj.enumnodes(node=_any, namespace=_any, prefix=_any)""" 
    347         idxonly = kw.get('idxonly', None) 
    348         if idxonly is not None: del kw['idxonly'] 
     349        if 'idxonly' in kw: 
     350            idxonly = kw['idxonly'] 
     351            del kw['idxonly'] 
     352        else: idxonly = False 
    349353        match = makenodematcher(*args, **kw) 
    350354        idx = 0 
    351355        for each in self.elems: 
    352356            if not isinstance(each, basestring): 
    353                 if match(*args, **kw): 
    354                     if idxonly: yield idx 
    355                     else: yield idx, each 
     357                if match(each): 
     358                    if idxonly:  
     359                        yield idx 
     360                    else:  
     361                        yield idx, each 
    356362            idx += 1 
    357363