File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 ]
You can’t perform that action at this time.
0 commit comments