Esempio n. 1
0
def change_fill_color_all_regions_based_on_my_count(soup):
    max_my_count = get_max_my_count_for_all_regions()
    for region in Region.create_all():
        change_fill_color_of_path(
            soup, region.name, get_region_count_fraction_color(
                region.my_count / max_my_count))
    prepare_legend(soup)
Esempio n. 2
0
def change_fill_color_of_all_regions_based_on_presence_of_mysec(soup):
    all_regions_with_active_mysec = get_all_regions_with_active_mysec()
    for region in Region.create_all():
        change_fill_color_of_path(
            soup, region.name, get_region_mysec_presence_color(
                region in all_regions_with_active_mysec))
Esempio n. 3
0
def change_fill_color_of_all_regions_based_on_looking_state(soup):
    print_current_looking_state_of_regions()
    toggle_looking_states_in_db(prompt_region_ids_for_looking_state_change())
    for region in Region.create_all():
        change_fill_color_of_path(
            soup, region.name, get_region_looking_color(region.looking_state))
Esempio n. 4
0
def get_max_my_frequency_for_all_regions():
    all_regions = Region.create_all()
    region_with_max_my_frequency = functools.reduce(
        lambda a, b: a if a.my_frequency > b.my_frequency else b, all_regions)
    return region_with_max_my_frequency.my_frequency
Esempio n. 5
0
def get_max_my_count_for_all_regions():
    all_regions = Region.create_all()
    region_with_max_my_count = functools.reduce(
        lambda a, b: a if a.my_count > b.my_count else b, all_regions)
    return region_with_max_my_count.my_count
Esempio n. 6
0
def print_current_looking_state_of_regions():
    for region in Region.create_all():
        print(f"{region.id}\t{region.looking_state}\t{region.name}")