Skip to content

Commit d6e90ad

Browse files
authored
Create os.py
1 parent 6223dbd commit d6e90ad

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

translations/en/os.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
class OSState:
2+
def __init__(self):
3+
self.user_name = "Usee"
4+
self.theme = "dark"
5+
self.lock_code = "1234"
6+
self.notes = ""
7+
self.files = [
8+
"document.txt",
9+
"image.png",
10+
"notes.md",
11+
"config.sys",
12+
]
13+
14+
def run_command(self, command: str) -> str:
15+
command = command.strip().lower()
16+
if command == "help":
17+
return (
18+
"Avaibile Commands:\n"
19+
"help - view this message\n"
20+
"list - view the files\n"
21+
"clear - clear the screen\n"
22+
"exit - close the terminal"
23+
)
24+
if command == "list":
25+
return "\n".join(self.files)
26+
if command == "clear":
27+
return "[screen cleared]"
28+
if command == "exit":
29+
return "Close the Terminal window or return to the desktop."
30+
if not command:
31+
return ""
32+
return f"Command not recognized: {command}"
33+
34+
def get_file_listing(self):
35+
return [f"- {name}" for name in self.files]

0 commit comments

Comments
 (0)