Skip to content

Commit

Permalink
style: run ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
merydian committed Dec 2, 2024
1 parent 4c15f92 commit f2324a1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ORStools/utils/maptools.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* *
***************************************************************************/
"""

import json
import math

Expand All @@ -44,7 +45,6 @@
from qgis.PyQt.QtGui import QColor
from qgis.PyQt.QtWidgets import (
QApplication,

)

from ORStools import ROUTE_COLOR
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit f2324a1

Please sign in to comment.