def result_urls(election, raw=False):
    urls = {}
    state = election['state']['postal']
    datefilter = election['start_date'].replace('-', '')
    if raw:
        baker_cls = RawBaker
    else:
        baker_cls = Baker

    for level in reporting_levels_for_election(state, datefilter,
            election['race_type'], raw):
        filename = baker_cls.filename("csv", state=state, datefilter=datefilter,
            election_type=election['race_type'], reporting_level=level)
        urls[level] = published_url(state, filename, raw)

    return urls
Beispiel #2
0
def result_urls(election, raw=False):
    urls = {}
    state = election['state']['postal']
    datefilter = election['start_date'].replace('-', '')
    if raw:
        baker_cls = RawBaker
    else:
        baker_cls = Baker

    for level in reporting_levels_for_election(state, datefilter,
                                               election['race_type'], raw):
        filename = baker_cls.filename("csv",
                                      state=state,
                                      datefilter=datefilter,
                                      election_type=election['race_type'],
                                      reporting_level=level)
        urls[level] = published_url(state, filename, raw)

    return urls