diff --git a/main.py b/main.py index 4710fd3..915d5f1 100644 --- a/main.py +++ b/main.py @@ -1,18 +1,19 @@ import sys -from src.server.server import Server -from src.client.client import Client - def main(): if len(sys.argv) > 1: script_mode = sys.argv[1] if script_mode == 'server': + from src.server.server import Server + server = Server() server.start() elif script_mode == 'client': + from src.client.client import Client + client = Client() client.start() diff --git a/src/client/client.py b/src/client/client.py index 95a7713..b0546eb 100644 --- a/src/client/client.py +++ b/src/client/client.py @@ -1,6 +1,6 @@ import asyncio -from logic import ApplicationController +from src.client.logic import ApplicationController class Client: diff --git a/src/client/logic.py b/src/client/logic.py index 6f4cf3b..72e28ac 100644 --- a/src/client/logic.py +++ b/src/client/logic.py @@ -1,7 +1,7 @@ import asyncio -from client.communications import WebSocketClient -from client.inputs import KeyboardController +from src.client.communications import WebSocketClient +from src.client.inputs import KeyboardController class CommandGenerator: @@ -27,7 +27,7 @@ def __init__(self, uri): self.keyboard_controller = KeyboardController() self.state_old = "" - async def control_loop(self): + async def run(self): await self.ws_client.connect() self.keyboard_controller.start() while True: diff --git a/src/server/server.py b/src/server/server.py index e0b7b7e..13ef198 100644 --- a/src/server/server.py +++ b/src/server/server.py @@ -1,5 +1,5 @@ -from server.motor_controller import MotorController -from server.communications import MotorWebSocketServer +from src.server.motor_controller import MotorController +from src.server.communications import MotorWebSocketServer class Server: