コード例 #1
0
ファイル: highwayParser.py プロジェクト: tbonza/TrafficData
def lookup_pairs(datasource):
    """ Create data structure from parsed pair_routes.xml """
    lookup_dict = {}
    count = 0
    start = time.time()
    while count < len(parse_pair_id(datasource)):
        lookup_dict[parse_pair_id(datasource)[count]\
            [u'PairID']] = parse_tags(datasource, count)
        count += 1
    # logging loops
    logging.info("Time elapsed for lookup_pairs parse: "+\
                 str(time.time() - start))
    return lookup_dict
コード例 #2
0
def lookup_pairs(datasource):
    """ Create data structure from parsed pair_routes.xml """
    lookup_dict = {}
    count = 0
    start = time.time()
    while count < len(parse_pair_id(datasource)):
        lookup_dict[parse_pair_id(datasource)[count]\
            [u'PairID']] = parse_tags(datasource, count)
        count += 1
    # logging loops
    logging.info("Time elapsed for lookup_pairs parse: "+\
                 str(time.time() - start))
    return lookup_dict
コード例 #3
0
 def test_parse_pair_id(self):
     """ Did we retrieve pair_id successfully? """
     nt.assert_equal(len(parse_pair_id(self.open_xml())),2)
コード例 #4
0
 def test_parse_pair_id(self):
     """ Did we retrieve pair_id successfully? """
     nt.assert_equal(len(parse_pair_id(self.open_xml())), 2)