reduce lines

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

View file

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