Skip to content

Commit f45d984

Browse files
committed
Update Python code to pass checks
1 parent 7faf7da commit f45d984

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/main/python/constants.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from enum import Enum
22

3+
34
class Keys(str, Enum):
45
POINTS = "POINTS"
56
LABELS = "LABELS"
@@ -9,13 +10,16 @@ class Keys(str, Enum):
910
MIN = "MIN"
1011
AVAILABLE_UNITS = "AVAILABLE_UNITS"
1112

13+
1214
class ApplicationStates(str, Enum):
1315
CLOSE = "CLOSE"
1416

17+
1518
class MessageKeys(str, Enum):
1619
STATUS = "status"
1720
SOLUTION_VELOCITY_STATUS = "solutionVelocityStatus"
1821
TRACKING_SIGNALS_STATUS = "trackingSignalsStatus"
1922

23+
2024
class QTKeys(str, Enum):
2125
QVARIANTLIST = "QVariantList"

src/main/python/main.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import sys
66
import threading
77

8-
from typing import Dict, List, Optional, Tuple, Any
8+
from typing import Dict, List, Any
99

1010
import capnp # type: ignore
1111

@@ -14,7 +14,7 @@
1414
from fbs_runtime.application_context.PySide2 import ApplicationContext # type: ignore # pylint: disable=unused-import
1515

1616
from PySide2.QtCore import QUrl, QObject, Slot, QPointF
17-
from PySide2.QtCharts import QtCharts
17+
from PySide2.QtCharts import QtCharts # pylint: disable=unused-import
1818

1919
from PySide2 import QtQml, QtCore
2020

@@ -81,6 +81,7 @@ def receive_messages(app_, backend, messages):
8181
else:
8282
pass
8383

84+
8485
class DataModel(QObject):
8586

8687
endpoint: console_backend.server.ServerEndpoint # pylint: disable=no-member
@@ -128,6 +129,7 @@ def solution_velocity_unit(self, unit: str) -> None:
128129
buffer = m.to_bytes()
129130
self.endpoint.send_message(buffer)
130131

132+
131133
class SolutionVelocityPoints(QObject):
132134

133135
_colors: List[str] = []
@@ -186,7 +188,7 @@ def set_available_units(self, available_units: List[str]) -> None:
186188
"""
187189
self._available_units = available_units
188190

189-
available_units = Property(QTKeys.QVARIANTLIST, get_available_units, set_available_units)
191+
available_units = Property(QTKeys.QVARIANTLIST, get_available_units, set_available_units) # type: ignore
190192

191193
def get_colors(self) -> List[str]:
192194
return self._colors
@@ -209,6 +211,7 @@ def fill_series(self, series_list):
209211
for idx, series in enumerate(series_list):
210212
series.replace(self._points[idx])
211213

214+
212215
class SolutionVelocityModel(QObject): # pylint: disable=too-few-public-methods
213216
@Slot(SolutionVelocityPoints) # type: ignore
214217
def fill_console_points(self, cp: SolutionVelocityPoints) -> SolutionVelocityPoints: # pylint:disable=no-self-use
@@ -308,6 +311,7 @@ def fill_series(self, series_list):
308311
if idx < len(self._points):
309312
series.replace(self._points[idx])
310313

314+
311315
class TrackingSignalsModel(QObject): # pylint: disable=too-few-public-methods
312316
@Slot(TrackingSignalsPoints) # type: ignore
313317
def fill_console_points(self, cp: TrackingSignalsPoints) -> TrackingSignalsPoints: # pylint:disable=no-self-use
@@ -319,6 +323,7 @@ def fill_console_points(self, cp: TrackingSignalsPoints) -> TrackingSignalsPoint
319323
cp.set_min(TRACKING_SIGNALS_TAB[Keys.MIN])
320324
return cp
321325

326+
322327
def is_frozen() -> bool:
323328
"""Check whether the application is frozen.
324329
@@ -329,6 +334,7 @@ def is_frozen() -> bool:
329334
"""
330335
return getattr(sys, "frozen", False) or "__compiled__" in globals()
331336

337+
332338
def get_capnp_path() -> str:
333339
"""Get the path to the capnp file based on current installer.
334340

0 commit comments

Comments
 (0)