From 657ea2f3e77c343240a9808b909c6a4e88d74db7 Mon Sep 17 00:00:00 2001 From: blacktwin Date: Fri, 21 Jul 2017 10:31:29 -0400 Subject: [PATCH] check PLATFORM_COLORS if platform is missing from PLATFORM_COLORS then default to DEFAULT_COLOR. --- maps/ips_to_maps.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/maps/ips_to_maps.py b/maps/ips_to_maps.py index 3e80ae5..81be737 100644 --- a/maps/ips_to_maps.py +++ b/maps/ips_to_maps.py @@ -299,7 +299,11 @@ def draw_map(map_type, geo_dict, filename): zord = 3 alph = 1 else: - color = PLATFORM_COLORS[data['platform']] + if data['platform'] in PLATFORM_COLORS: + color = PLATFORM_COLORS[data['platform']] + else: + color = DEFAULT_COLOR + print('Platform: {} is missing from PLATFORM_COLORS. Using DEFAULT_COLOR.'.format(data['platform'])) marker = '.' if data['play_count'] >= 100: markersize = (data['play_count'] * .1)