Skip to content
Browse files

Correct propagation of XML namespace to constructors.

  • Loading branch information...
1 parent f8e4632 commit aa09688ea09edbaef0187377740e5fb8f7c95c3e @twpayne twpayne committed Apr 6, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 igc2kmz/task.py
View
4 igc2kmz/task.py
@@ -126,11 +126,11 @@ def from_element(cls, element, namespace):
name_tag = element.find('{%s}name' % namespace)
name = None if name_tag is None else name_tag.text.encode('utf_8')
rtepts = element.findall('{%s}rtept' % namespace)
- tps = map(Turnpoint.from_element, rtepts)
+ tps = [Turnpoint.from_element(rtept, namespace) for rtept in rtepts]
return cls(name, tps)
@classmethod
def from_file(cls, file):
element = parse(file)
namespace = re.match('\{(.*)\}', element.getroot().tag).group(1)
- return cls.from_element(element.find('/{%s}rte' % namespace), element)
+ return cls.from_element(element.find('/{%s}rte' % namespace), namespace)

0 comments on commit aa09688

Please sign in to comment.
Something went wrong with that request. Please try again.