Skip to content

Commit 19c7a4b

Browse files
authored
Merge pull request #53 from JdeRobot/issue-52
Fix pydantic missing type annotations
2 parents 807b019 + 13f7886 commit 19c7a4b

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

manager/comms/consumer_message.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import json
44
from functools import singledispatchmethod
5-
from typing import Any
5+
from typing import Any, Optional
66

77
from pydantic import BaseModel
88

@@ -16,7 +16,7 @@ class ManagerConsumerMessage(BaseModel):
1616
"""
1717
id: str
1818
command: str
19-
data: Any
19+
data: Optional[Any] = None
2020

2121
def response(self, response: Any = None) -> ManagerConsumerMessage:
2222
"""

manager/manager/launcher/launcher_console.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
import time
55
import os
66
import stat
7+
from typing import List, Any
78

89

910
class LauncherConsole(ILauncher):
1011
display: str
11-
internal_port: str
12-
external_port: str
13-
running = False
14-
threads = []
12+
internal_port: int
13+
external_port: int
14+
running:bool = False
15+
threads: List[Any] = []
1516

1617
def run(self, callback):
1718
DRI_PATH = os.path.join("/dev/dri", os.environ.get("DRI_NAME", "card0"))

manager/manager/launcher/launcher_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class LauncherEngine(BaseModel):
1010
exercise_id: str
1111
launch: dict
1212

13-
module = '.'.join(__name__.split('.')[:-1])
13+
module:str = '.'.join(__name__.split('.')[:-1])
1414
terminated_callback: Any = None
1515

1616
def run(self):

manager/manager/launcher/launcher_gazebo_view.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
import time
55
import os
66
import stat
7+
from typing import List, Any
78

89

910
class LauncherGazeboView(ILauncher):
1011
exercise_id: str
1112
display: str
12-
internal_port: str
13-
external_port: str
13+
internal_port: int
14+
external_port: int
1415
height: int
1516
width: int
16-
running = False
17-
threads = []
17+
running: bool = False
18+
threads: List[Any] = []
1819

1920
def run(self, callback):
2021
DRI_PATH = os.path.join(

0 commit comments

Comments
 (0)