Exemple #1
0
def update_ap_data():
    """
    Gets actual AP data from the AP's top-of-ticket file.
    """
    data = i.get_ap_data()
    ne_data = i.get_ap_district_data('NE')
    me_data = i.get_ap_district_data('ME')

    i.parse_ap_data(data, ne_data, me_data)
Exemple #2
0
def update_ap_data():
    """
    Gets actual AP data from the AP's top-of-ticket file.
    """
    data = i.get_ap_data()
    ne_data = i.get_ap_district_data('NE')
    me_data = i.get_ap_district_data('ME')

    i.parse_ap_data(data, ne_data, me_data)
Exemple #3
0
def save_ap_data():
    minute = datetime.datetime.now().minute
    hour = datetime.datetime.now().hour
    with open('test_data/timemachine/US_%s-%s.txt' % (hour, minute), 'w') as f:
        data = ''
        for line in i.get_ap_data():
            data += line
        f.write(data)

    for state_code in ['NE', 'ME']:
        try:
            with open('test_data/timemachine/%s_D_%s-%s.txt' % (state_code, hour, minute), 'w') as f:
                data = ''
                for line in i.get_ap_district_data(state_code):
                    data += line
                f.write(data)
        except:
            pass
Exemple #4
0
def save_ap_data():
    minute = datetime.datetime.now().minute
    hour = datetime.datetime.now().hour
    with open('test_data/timemachine/US_%s-%s.txt' % (hour, minute), 'w') as f:
        data = ''
        for line in i.get_ap_data():
            data += line
        f.write(data)

    for state_code in ['NE', 'ME']:
        try:
            with open(
                    'test_data/timemachine/%s_D_%s-%s.txt' %
                (state_code, hour, minute), 'w') as f:
                data = ''
                for line in i.get_ap_district_data(state_code):
                    data += line
                f.write(data)
        except:
            pass