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-11-14 03:38:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
def prompt():
|
|
|
|
while True:
|
|
|
|
command = input("> ")
|
2024-11-15 22:39:49 +01:00
|
|
|
if quitCondition(command):
|
|
|
|
quitService(get_path())
|
2024-11-14 03:38:44 +01:00
|
|
|
break
|
2024-11-15 22:39:49 +01:00
|
|
|
if helpCondition(command):
|
|
|
|
print(help_list())
|
2024-11-14 03:38:44 +01:00
|
|
|
continue
|
2024-11-15 22:39:49 +01:00
|
|
|
if clearCondition(command):
|
2024-11-16 00:42:22 +01:00
|
|
|
clearScreen()
|
2024-11-14 03:38:44 +01:00
|
|
|
continue
|
|
|
|
if command.startswith("$"):
|
2024-11-15 22:39:49 +01:00
|
|
|
systemCommand(command)
|
2024-11-14 03:38:44 +01:00
|
|
|
continue
|
2024-11-15 22:39:49 +01:00
|
|
|
if restartCondition(command):
|
|
|
|
restartService(get_path())
|
2024-11-14 03:38:44 +01:00
|
|
|
continue
|
2024-11-15 22:39:49 +01:00
|
|
|
if runCondition(command):
|
|
|
|
runService()
|
2024-11-14 03:38:44 +01:00
|
|
|
continue
|
2024-11-14 18:51:15 +01:00
|
|
|
if command == "":
|
|
|
|
continue
|
2024-11-14 03:38:44 +01:00
|
|
|
else:
|
|
|
|
print("Command not found. Write 'h' for help.")
|
|
|
|
continue
|
|
|
|
sys.exit(0)
|