Beispiel #1
0
 def parse_thing(self):
     super(Weight, self).parse_thing()
     if self.thing_xml.xpath('data-xml') != []:
         xmlutils = XmlUtils(self.thing_xml)
         when_node = self.thing_xml.xpath('data-xml/weight/when')
         if len(when_node) > 0:
             self.when = xmlutils.get_datetime_from_when(when_node[0])
         self.value_kg = xmlutils.get_float_by_xpath('data-xml/weight/value/kg/text()')
         self.display_value = xmlutils.get_float_by_xpath('data-xml/weight/value/display/text()')
         self.display_unit = xmlutils.get_string_by_xpath('data-xml/weight/value/display/@units')
     else:
         self.is_partial = True
Beispiel #2
0
 def parse_thing(self):
     super(Height, self).parse_thing()
     if self.thing_xml.xpath("data-xml") != []:
         xmlutils = XmlUtils(self.thing_xml)
         when_node = self.thing_xml.xpath("data-xml/height/when")
         if len(when_node) > 0:
             self.when = xmlutils.get_datetime_from_when(when_node[0])
         self.value_m = xmlutils.get_float_by_xpath("data-xml/height/value/m/text()")
         self.display_value = xmlutils.get_float_by_xpath("data-xml/height/value/display/text()")
         self.display_unit = xmlutils.get_string_by_xpath("data-xml/height/value/display/@units")
     else:
         self.is_partial = True