Skip to content

Commit b14fba9

Browse files
hotfix: Solve Python typing errors (#9)
1 parent a3a68a6 commit b14fba9

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

core/observers/subject/base_subject.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def set_state(self, state: ObserverStates) -> None:
5050
self.notify()
5151

5252
@abstractmethod
53-
@staticmethod
5453
def get_default_state() -> ObserverStates:
5554
"""This method is called when the observer is updated."""
5655
raise NotImplementedError

core/observers/subject/eye_subject.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from datetime import datetime
88
from threading import Lock
99
from time import sleep
10+
from typing import Optional
1011

1112
import cv2
1213

@@ -56,7 +57,7 @@ def _cb_save(self, future) -> None:
5657

5758
def run(self,
5859
eye_strategy: BaseEyeStrategy,
59-
wifi_lock: Lock | None = None
60+
wifi_lock: Optional[Lock] = None
6061
) -> None:
6162
"""This method is called when the observer is updated."""
6263
thread = ThreadPoolExecutor(
@@ -65,9 +66,10 @@ def run(self,
6566
).submit(self._run_in_loop, self, eye_strategy, wifi_lock)
6667
thread.add_done_callback(self._cb_save)
6768

69+
@staticmethod
6870
def _run_in_loop(self,
6971
eye_strategy: BaseEyeStrategy,
70-
wifi_lock: Lock | None = None
72+
wifi_lock: Optional[Lock] = None
7173
) -> None:
7274
"""This method is called when the observer is updated."""
7375
logger.debug("[EyeSubject] Thread is started.")

core/observers/subject/wifi_subject.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from concurrent.futures import ThreadPoolExecutor
66
from threading import Lock
77
from time import sleep
8+
from typing import Optional
89

910
from core.observers.subject.base_subject import BaseSubject
1011
from core.strategies.wifi.base_wifi_strategy import BaseWiFiStrategy
@@ -20,7 +21,7 @@ class WiFiSubject(BaseSubject):
2021
This class inherits from IBaseSubject.
2122
Concretes a subject for WiFiS features.
2223
"""
23-
SINGLETON_LOCK: Lock | None = None
24+
SINGLETON_LOCK: Optional[Lock] = None
2425
CHECK_INTERVAL: int = 5
2526

2627
@staticmethod

core/strategies/detectors/efficientdet_strategy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55

66
import cv2
77
import numpy
8-
from base_detector_strategy import BaseDetectorStrategy, DetectorResult
98
from tflite_runtime.interpreter import Interpreter
109

10+
from .base_detector_strategy import BaseDetectorStrategy, DetectorResult
11+
1112

1213
class EfficientdetStrategy(BaseDetectorStrategy):
1314
"""

0 commit comments

Comments
 (0)