Skip to content

Commit

Permalink
Project Name: BattleBot
Browse files Browse the repository at this point in the history
Commit Type: Bugfix

Fixed a number of imports

- Changed the import location of the client and server packages after option selection
- fixed import paths inside of the server and client head files
- Changed the name of the control_loop function in the ApplicationController class to run

Signed-off-by: ButrosGroot <[email protected]>
  • Loading branch information
butros10games committed Feb 15, 2024
1 parent c19d16e commit 0b5dc3b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -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()

Expand Down
2 changes: 1 addition & 1 deletion src/client/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import asyncio

from logic import ApplicationController
from src.client.logic import ApplicationController


class Client:
Expand Down
6 changes: 3 additions & 3 deletions src/client/logic.py
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/server/server.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 0b5dc3b

Please sign in to comment.