diff --git a/python/=0.1.8 b/python/=0.1.8 deleted file mode 100644 index fc554dd..0000000 --- a/python/=0.1.8 +++ /dev/null @@ -1,38 +0,0 @@ -Requirement already satisfied: mypy==1.8.0 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (1.8.0) -Requirement already satisfied: pylint==3.2.5 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (3.2.5) -Requirement already satisfied: ruff==0.1.14 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (0.1.14) -Requirement already satisfied: pylint-protobuf==0.22.0 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (0.22.0) -Requirement already satisfied: remotivelabs-broker in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (0.1.26) -Requirement already satisfied: pytest in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (8.2.2) -Requirement already satisfied: tomli>=1.1.0 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from mypy==1.8.0) (2.0.1) -Requirement already satisfied: typing-extensions>=4.1.0 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from mypy==1.8.0) (4.12.2) -Requirement already satisfied: mypy-extensions>=1.0.0 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from mypy==1.8.0) (1.0.0) -Requirement already satisfied: dill>=0.2 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pylint==3.2.5) (0.3.8) -Requirement already satisfied: astroid<=3.3.0-dev0,>=3.2.2 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pylint==3.2.5) (3.2.2) -Requirement already satisfied: platformdirs>=2.2.0 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pylint==3.2.5) (4.2.2) -Requirement already satisfied: mccabe<0.8,>=0.6 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pylint==3.2.5) (0.7.0) -Requirement already satisfied: isort!=5.13.0,<6,>=4.2.5 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pylint==3.2.5) (5.13.2) -Requirement already satisfied: tomlkit>=0.10.1 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pylint==3.2.5) (0.12.5) -Requirement already satisfied: protobuf in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pylint-protobuf==0.22.0) (5.27.2) -Requirement already satisfied: requests~=2.21 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from remotivelabs-broker) (2.32.3) -Requirement already satisfied: grpc-stubs~=1.53.0.5 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from remotivelabs-broker) (1.53.0.5) -Collecting protobuf - Using cached protobuf-3.20.1-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.1 MB) -Requirement already satisfied: grpcio~=1.44 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from remotivelabs-broker) (1.64.1) -Requirement already satisfied: types-protobuf~=4.24.0.20240106 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from remotivelabs-broker) (4.24.0.20240408) -Requirement already satisfied: grpc-interceptor~=0.14 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from remotivelabs-broker) (0.15.4) -Requirement already satisfied: mypy-protobuf~=3.3.0 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from remotivelabs-broker) (3.3.0) -Requirement already satisfied: iniconfig in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pytest) (2.0.0) -Requirement already satisfied: exceptiongroup>=1.0.0rc8 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pytest) (1.2.1) -Requirement already satisfied: pluggy<2.0,>=1.5 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pytest) (1.5.0) -Requirement already satisfied: packaging in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from pytest) (24.1) -Requirement already satisfied: certifi>=2017.4.17 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from requests~=2.21->remotivelabs-broker) (2024.6.2) -Requirement already satisfied: idna<4,>=2.5 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from requests~=2.21->remotivelabs-broker) (3.7) -Requirement already satisfied: urllib3<3,>=1.21.1 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from requests~=2.21->remotivelabs-broker) (2.2.2) -Requirement already satisfied: charset-normalizer<4,>=2 in /mnt/c/Users/Oscar Gren/Documents/RemotiveLabs/lib/python3.10/site-packages (from requests~=2.21->remotivelabs-broker) (3.3.2) -Installing collected packages: protobuf - Attempting uninstall: protobuf - Found existing installation: protobuf 5.27.2 - Uninstalling protobuf-5.27.2: - Successfully uninstalled protobuf-5.27.2 -Successfully installed protobuf-3.20.1 diff --git a/python/simple-ecu/ecu.py b/python/simple-ecu/ecu.py index ac6029c..6db4936 100644 --- a/python/simple-ecu/ecu.py +++ b/python/simple-ecu/ecu.py @@ -82,7 +82,7 @@ def ecu_a(stub: br.network_api_pb2_grpc.NetworkServiceStub, signal_creator: br.S increasing_counter = counter_start_value + (increasing_counter + 1) % 4 -def read_on_timer(stub: br.network_api_pb2_grpc.NetworkServiceStub, signals: br.network_api_pb2.Signals, pause: int) -> None: +def read_on_timer(stub: br.network_api_pb2_grpc.NetworkServiceStub, signals: Sequence[br.common_pb2.SignalId], pause: int) -> None: """Simple reading with timer Parameters @@ -157,7 +157,7 @@ def double_and_publish( network_stub: br.network_api_pb2_grpc.NetworkServiceStub, client_id: br.common_pb2.ClientId, trigger: Any, - signals: br.network_api_pb2.Signals, + signals: Sequence[br.network_api_pb2.Signal], signal_creator: br.SignalCreator, ) -> None: if signal_creator is None: @@ -184,11 +184,11 @@ def subscribe( broker: Any, client_id: br.common_pb2.ClientId, network_stub: br.network_api_pb2_grpc.NetworkServiceStub, - signals: br.network_api_pb2.Signals, + signals: Sequence[br.common_pb2.SignalId], on_subscribe: Callable[[Sequence[br.network_api_pb2.Signal]], None], on_change: bool = False, -) -> grpc.RpcContext: - sync = queue.Queue() +) -> Any: + sync: queue.Queue[Any] = queue.Queue() Thread( target=broker.act_on_signal, args=( @@ -197,7 +197,7 @@ def subscribe( signals, on_change, # True: only report when signal changes on_subscribe, - lambda subscription: (sync.put(subscription)), + sync.put, ), ).start() # wait for subscription to settle @@ -205,7 +205,7 @@ def subscribe( return subscription -def run(url: str, configuration: str, x_api_key: Optional[str] = None, access_token: Optional[str] = None) -> None: +def run(url: str, configuration_folder: str, x_api_key: Optional[str] = None, access_token: Optional[str] = None) -> None: """Main function, checking arguments passed to script, setting up stubs, configuration and starting Threads.""" # Setting up stubs and configuration intercept_channel = br.create_channel(url, x_api_key, access_token) @@ -214,8 +214,8 @@ def run(url: str, configuration: str, x_api_key: Optional[str] = None, access_to system_stub = br.system_api_pb2_grpc.SystemServiceStub(intercept_channel) br.check_license(system_stub) - print(f"Using configuration {configuration}") - br.upload_folder(system_stub, configuration) + print(f"Using configuration {configuration_folder}") + br.upload_folder(system_stub, configuration_folder) br.reload_configuration(system_stub) signal_creator = br.SignalCreator(system_stub) @@ -250,7 +250,7 @@ def run(url: str, configuration: str, x_api_key: Optional[str] = None, access_to # ecu a, this is where we publish, and Thread( target=ecu_a, - args=(network_stub,signal_creator), + args=(network_stub, signal_creator), ).start() # ecu b, bonus, periodically, read using timer.