From e5114ef9d1000bb480e7091169b14a2461563ed1 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Thu, 1 Sep 2011 14:24:56 -0400 Subject: [PATCH] added attributes_list() method0 --- sfa/rspecs/rspec.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sfa/rspecs/rspec.py b/sfa/rspecs/rspec.py index 1a0c3ad7..85c8c88f 100755 --- a/sfa/rspecs/rspec.py +++ b/sfa/rspecs/rspec.py @@ -164,6 +164,15 @@ class RSpec: parent = element.getparent() parent.remove(element) + def attributes_list(self, elem): + # convert a list of attribute tags into list of tuples + # (tagnme, text_value) + opts = [] + if elem is not None: + for e in elem: + opts.append((e.tag, str(e.text).strip())) + return opts + def get_element_attributes(self, elem=None, depth=0): if elem == None: elem = self.root_node -- 2.47.0