reduce lines

This commit is contained in:
Frank Adaemmer 2023-05-21 14:58:14 +02:00
parent b53b1cacb2
commit 1d37f31a7e

View file

@ -106,14 +106,20 @@ def generateWeek(week, persons, locations, output_path=Path('.')):
img = create_circle(image_paths) img = create_circle(image_paths)
img.save(output_path / Path(png_file)) img.save(output_path / Path(png_file))
bases = [] bases = []
base_names = []
popup = "<h2>%s</h2>" % cur_loc popup = "<h2>%s</h2>" % cur_loc
for cur_per, cur_info in cur_persons.items(): for cur_per, cur_info in cur_persons.items():
popup += "<h3>%s</h3>" % cur_per popup += "<h3>%s</h3>" % cur_per
popup += "</br>".join(cur_info['tasks']) popup += "</br>".join(cur_info['tasks'])
if cur_info['base'] != cur_loc: if cur_info['base'] != cur_loc:
l = [x for x in locations if x['name'] == cur_info['base']][0] base_names.append(cur_info['base'])
base_names = list(set(base_names))
for base in base_names:
l = [x for x in locations if x['name'] == base][0]
bases.append({ bases.append({
"city": cur_info['base'], "city": base,
"lat": l['lat'], "lat": l['lat'],
"lng": l['lng'], "lng": l['lng'],
}) })