Skip to content

Commit a2dfe9c

Browse files
committed
move cli flies into new directory
1 parent b50da83 commit a2dfe9c

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed
Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
from sys import argv
66
from typing import cast
77

8-
from serial import Serial
8+
from serial import Serial, SerialException
99
from textual import on
1010
from textual.app import App, ComposeResult
1111
from textual.containers import HorizontalGroup, HorizontalScroll, ScrollableContainer, VerticalScroll
1212
from textual.reactive import reactive
1313
from textual.widget import Widget
1414
from textual.widgets import Button, DataTable, Input, Label, Static
1515

16-
from gs.backend.ground_station_cli import GroundStationShell
16+
from gs.backend.gs_cli.ground_station_cli import GroundStationShell
1717

1818
if len(argv) == 2:
1919
COM_PORT = argv[1]
@@ -301,15 +301,20 @@ def compose(self) -> ComposeResult:
301301

302302
def main() -> None:
303303
"""
304-
Usage: Entry point for the CLI application; opens the serial port at the com port and runs the ground station cli.
304+
Entry point for the CLI application; opens the serial port at the com port and runs the ground station cli.
305305
"""
306306
if len(argv) != 2:
307307
print("One argument needed: Com Port")
308308
return
309309

310-
ser = Serial(COM_PORT)
311-
print("Comm port set to: " + str(ser.name))
312-
ser.close()
310+
try:
311+
ser = Serial(COM_PORT)
312+
print("Comm port set to: " + str(ser.name))
313+
ser.close()
314+
315+
except SerialException as e:
316+
print(f"An error occurred while opening the serial port: {e}")
317+
313318

314319
app = CLIWindow()
315320
app.run()

0 commit comments

Comments
 (0)