Пример #1
0
    def parse(self, xml):
        xml = XMLParser.parse(self, xml)

        _, begin = self.searchFirst(xml, 'beginPosition')
        _, end = self.searchFirst(xml, 'endPosition')

        return qgstime.QgsTimePeriod(begin, end)
Пример #2
0
    def parse (self, xml):
        xml = XMLParser.parse(self, xml)
        
        _, begin = self.searchFirst(xml, 'beginPosition')
        _, end = self.searchFirst(xml, 'endPosition')

        return qgstime.QgsTimePeriod(begin, end)
Пример #3
0
    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()
Пример #4
0
 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()
Пример #5
0
    def parse(self, xml):
        xml = XMLParser.parse(self, xml)

        _, time = self.searchFirst(xml, 'timePosition')
        return qgstime.QgsTimeInstant(time)
Пример #6
0
    def parse (self, xml):
        xml = XMLParser.parse(self, xml)

        _, time = self.searchFirst(xml, 'timePosition')
        return qgstime.QgsTimeInstant (time)
Пример #7
0
def main():
    parser = XMLParser(sys.argv[1])
    parser.parse()