MCPcopy Create free account
hub / github.com/ActiveState/code / join

Method join

recipes/Python/576445_ElementTree_Wrapper/recipe-576445.py:187–203  ·  view source on GitHub ↗

Usage: elt.join(iterable) returns list of elements from iterable separated by elt Example: xml('html', xml('body', *xml('br').join(xml('span',text) for text in ['foo','bar','baz'])))

(self,iterable)

Source from the content-addressed store, hash-verified

185 def findall(self,path):
186 return [xml(elt) for elt in self.__content.findall(path)]
187 def join(self,iterable):
188 """
189 Usage:
190 elt.join(iterable)
191 returns list of elements from iterable separated by elt
192
193 Example:
194 xml('html', xml('body', *xml('br').join(xml('span',text) for text in ['foo','bar','baz'])))
195 """
196 join_list = []
197 for elt in iterable:
198 assert type(elt) == xml
199 join_list.append(elt)
200 join_list.append(self)
201 if len(join_list) > 0:
202 join_list.pop()
203 return join_list
204 def extend(self,iterable):
205 for elt in iterable:
206 assert type(elt) == xml

Callers 15

receiveFunction · 0.45
test1Function · 0.45
test2Function · 0.45
__internalRecursePathMethod · 0.45
attr_strFunction · 0.45
pretty_listMethod · 0.45
prettyMethod · 0.45
__path_from_listMethod · 0.45
test2Function · 0.45
renameFunction · 0.45
undoFunction · 0.45
escape_entitiesFunction · 0.45

Calls 2

appendMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected