[P] Code cleanup.

This commit is contained in:
2026-03-27 13:57:02 +01:00
parent c5f6fbf7af
commit 51fca8436a
2 changed files with 8 additions and 8 deletions

View File

@@ -63,7 +63,7 @@ class MapViewApp(App):
# Оновлює лінію маршрута
if user_id not in self.line_layers:
self.line_layers[user_id] = LineMapLayer(color = line_layer_colors[user_id % len(line_layer_colors)])
self.line_layers[user_id] = LineMapLayer(color=line_layer_colors[user_id % len(line_layer_colors)])
self.mapview.add_layer(self.line_layers[user_id])
self.line_layers[user_id].add_point((lat, lon))
@@ -109,7 +109,7 @@ class MapViewApp(App):
try:
return next(flt)
except StopIteration as e:
except StopIteration:
return None
def set_pothole_marker(self, point):
@@ -145,14 +145,14 @@ class MapViewApp(App):
if lat is None or lon is None:
return
clicked_marker_data = self.datasource.map_lat_lon_to_ProcessedAgentData(lat, lon)
clicked_marker_data = self.datasource.map_lat_lon_to_processed_agent_data(lat, lon)
if not clicked_marker_data:
return
clicked_marker = self.map_lat_lon_to_marker(clicked_marker_data.latitude, clicked_marker_data.longitude)
if clicked_marker == None:
if clicked_marker is None:
return
self.mapview.remove_marker(clicked_marker)
@@ -168,7 +168,6 @@ class MapViewApp(App):
self.delete_pothole_marker(coordinate)
return True
def build(self):
"""
Ініціалізує мапу MapView(zoom, lat, lon)
@@ -180,7 +179,7 @@ class MapViewApp(App):
lon=30.5234
)
self.mapview.bind(on_touch_down = self.on_touch_down)
self.mapview.bind(on_touch_down=self.on_touch_down)
return self.mapview