Changeset 2
- Timestamp:
- Mar 17, 2005 11:40:26 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/Rappture/library.py
r1 r2 73 73 74 74 # ------------------------------------------------------------------ 75 def children(self, path="", flavor="object" ):75 def children(self, path="", flavor="object", type=None): 76 76 """ 77 77 Clients use this to query the children of a particular element 78 78 within the entire data structure. This is just like the 79 79 element() method, but it returns the children of the element 80 instead of the element itself. 80 instead of the element itself. If the optional type argument 81 is specified, then the return list is restricted to children 82 of the specified type. 81 83 82 84 By default, this method returns a list of objects representing … … 93 95 94 96 nlist = [n for n in node.childNodes if not n.nodeName.startswith('#')] 97 98 if type: 99 nlist = [n for n in nlist if n.nodeName == type] 95 100 96 101 if flavor == 'object':
Note: See TracChangeset
for help on using the changeset viewer.