2024-11-14 03:38:44 +01:00
|
|
|
import sys
|
2024-11-15 22:39:49 +01:00
|
|
|
from threads.commands import *
|
|
|
|
from run_command import run_command
|
|
|
|
from get_path import get_path
|
|
|
|
from threads.help_list import help_list
|
2024-12-18 01:41:12 +01:00
|
|
|
import time
|
2024-11-14 03:38:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
def prompt():
|
|
|
|
while True:
|
2024-12-18 01:41:12 +01:00
|
|
|
try:
|
|
|
|
command = input("> ")
|
|
|
|
if quitCondition(command):
|
|
|
|
quitService(get_path())
|
|
|
|
break
|
|
|
|
elif helpCondition(command):
|
|
|
|
print(help_list())
|
|
|
|
elif clearCondition(command):
|
|
|
|
clearScreen()
|
|
|
|
elif command.startswith("$"):
|
|
|
|
systemCommand(command)
|
|
|
|
elif restartCondition(command):
|
|
|
|
restartService(get_path())
|
|
|
|
elif runCondition(command):
|
|
|
|
runService()
|
|
|
|
elif command == "":
|
|
|
|
pass
|
|
|
|
else:
|
|
|
|
print(f"Command: {command} not found. Write 'h' for help.")
|
|
|
|
time.sleep(0.1)
|
|
|
|
except KeyboardInterrupt:
|
|
|
|
print("\nExiting...")
|
2024-11-15 22:39:49 +01:00
|
|
|
quitService(get_path())
|
2024-11-14 03:38:44 +01:00
|
|
|
sys.exit(0)
|