From f2324a16c4a2242a824a0d3cb4898b7ad3796039 Mon Sep 17 00:00:00 2001 From: Till Frankenbach Date: Mon, 2 Dec 2024 13:06:09 +0100 Subject: [PATCH] style: run ruff --- ORStools/utils/maptools.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ORStools/utils/maptools.py b/ORStools/utils/maptools.py index 1142bb1..2c4dff2 100644 --- a/ORStools/utils/maptools.py +++ b/ORStools/utils/maptools.py @@ -26,6 +26,7 @@ * * ***************************************************************************/ """ + import json import math @@ -44,7 +45,6 @@ from qgis.PyQt.QtGui import QColor from qgis.PyQt.QtWidgets import ( QApplication, - ) from ORStools import ROUTE_COLOR @@ -76,9 +76,7 @@ def __init__(self, dlg): self.dlg.routing_travel_combo.currentIndexChanged.connect(self._toggle_preview) self.pointPressed.connect(lambda point: self._on_movetool_map_press(point)) - self.pointReleased.connect( - lambda event, idx: self._on_movetool_map_release(event, idx) - ) + self.pointReleased.connect(lambda event, idx: self._on_movetool_map_release(event, idx)) self.mouseMoved.connect(lambda pos: self.change_cursor_on_hover(pos)) self.last_click = "single-click" @@ -145,7 +143,9 @@ def canvasPressEvent(self, event): if self.dlg.rubber_band: self.dlg.rubber_band.reset() self.move_i = self.dlg.annotations.index(hovering) - self.dlg.project.annotationManager().removeAnnotation(self.dlg.annotations.pop(self.move_i)) + self.dlg.project.annotationManager().removeAnnotation( + self.dlg.annotations.pop(self.move_i) + ) self.moving = True def canvasReleaseEvent(self, event): @@ -307,6 +307,7 @@ def api_key_message_bar(self): level=Qgis.MessageLevel.Warning, duration=3, ) + def _toggle_preview(self): if self.dlg.routing_fromline_list.count() > 0: state = not self.dlg.toggle_preview.isChecked()