def obtain_tree():
    #print 'twitter_helper.py/obtain_tree'
    all_cities = cities.US + cities.EU
    cities_names = [cities.short_name(c) for c in cities.NAMES]
    bboxes = [Bbox(city, name) for city, name in zip(all_cities,
                                                     cities_names)]
    return build_tree(bboxes)
示例#2
0
def valid_city(city):
    """Ensure city argument is valid"""
    import cities
    city = cities.short_name(city)
    if city == 'whole' or city in cities.SHORT_KEY:
        return city
    raise argparse.ArgumentTypeError('{} is not a known city'.format(city))
示例#3
0
def obtain_tree():
    all_cities = cities.US + cities.EU
    cities_names = [cities.short_name(c) for c in cities.NAMES]
    bboxes = [Bbox(city, name) for city, name in zip(all_cities,
                                                     cities_names)]
    return build_tree(bboxes)
def obtain_tree():
    #print 'twitter_helper.py/obtain_tree'
    all_cities = cities.US + cities.EU
    cities_names = [cities.short_name(c) for c in cities.NAMES]
    bboxes = [Bbox(city, name) for city, name in zip(all_cities, cities_names)]
    return build_tree(bboxes)
示例#5
0
def obtain_tree():
    all_cities = cities.US + cities.EU
    cities_names = [cities.short_name(c) for c in cities.NAMES]
    bboxes = [Bbox(city, name) for city, name in zip(all_cities, cities_names)]
    return build_tree(bboxes)