From e0af3e036c692734c786546620e203ab7ab783ff Mon Sep 17 00:00:00 2001 From: Tony Mack <tmack@paris.CS.Princeton.EDU> Date: Thu, 30 Jun 2011 15:26:54 -0400 Subject: [PATCH] replace 'recursive' argument with 'depth' argument in get_attributes() --- sfa/rspecs/elements/element.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sfa/rspecs/elements/element.py b/sfa/rspecs/elements/element.py index 898706eb..8217c118 100644 --- a/sfa/rspecs/elements/element.py +++ b/sfa/rspecs/elements/element.py @@ -59,12 +59,12 @@ class Element: if opt.text == value: elem.remove(opt) - def get_attributes(self, elem=None, recursive=False): + def get_attributes(self, elem=None, depth=None): if elem == None: elem = self.root_node attrs = dict(elem.attrib) attrs['text'] = str(elem.text).strip() - if recursive: + if depth is None or isinstance(depth, int) and depth > 0: for child_elem in list(elem): key = str(child_elem.tag) if key not in attrs: -- 2.47.0