def parse(self, xml): xml = XMLParser.parse(self, xml) _, begin = self.searchFirst(xml, 'beginPosition') _, end = self.searchFirst(xml, 'endPosition') return qgstime.QgsTimePeriod(begin, end)
def parse (self, xml): xml = XMLParser.parse(self, xml) _, begin = self.searchFirst(xml, 'beginPosition') _, end = self.searchFirst(xml, 'endPosition') return qgstime.QgsTimePeriod(begin, end)
def parse(self, xml): xml = XMLParser.parse(self, xml) timeNode, timeType = self.searchFirst(xml, '*@type') if not timeType: timeNode, _ = self.searchFirst(xml, '*@id') timeType = 'gml:' + timeNode.tagName() + 'Type' if timeType == 'gml:TimePeriodType': return GMLTimePeriodParser().parse(timeNode) elif timeType == 'gml:TimeInstantType': return GMLTimeInstantParser().parse(timeNode) else: return qgstime.QgsTime()
def parse (self, xml): xml = XMLParser.parse(self, xml) timeNode, timeType = self.searchFirst(xml, '*@type') if not timeType: timeNode, _ = self.searchFirst(xml, '*@id') timeType = 'gml:' + timeNode.tagName() + 'Type' if timeType == 'gml:TimePeriodType': return GMLTimePeriodParser().parse(timeNode) elif timeType == 'gml:TimeInstantType': return GMLTimeInstantParser().parse(timeNode) else: return qgstime.QgsTime()
def parse(self, xml): xml = XMLParser.parse(self, xml) _, time = self.searchFirst(xml, 'timePosition') return qgstime.QgsTimeInstant(time)
def parse (self, xml): xml = XMLParser.parse(self, xml) _, time = self.searchFirst(xml, 'timePosition') return qgstime.QgsTimeInstant (time)
def main(): parser = XMLParser(sys.argv[1]) parser.parse()