git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a9af00f
)
added attributes_list() method0
author
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Thu, 1 Sep 2011 18:24:56 +0000
(14:24 -0400)
committer
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Thu, 1 Sep 2011 18:24:56 +0000
(14:24 -0400)
sfa/rspecs/rspec.py
patch
|
blob
|
history
diff --git
a/sfa/rspecs/rspec.py
b/sfa/rspecs/rspec.py
index
1a0c3ad
..
85c8c88
100755
(executable)
--- 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