Skip to content

Commit a053a23

Browse files
committed
Add feedback program and owldbg_err command, update readme
1 parent 8d3c6d6 commit a053a23

File tree

7 files changed

+29
-4
lines changed

7 files changed

+29
-4
lines changed

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ mkdir `</>`
1414

1515
mkfile `</>`
1616

17+
owldbg_err `</>`
18+
1719
# Authors
1820

1921
`JasonMo` `jasonmo2009@hotmail.com`
647 Bytes
Binary file not shown.

src/owl/cache/feedback.txt

Whitespace-only changes.
3 Bytes
Binary file not shown.

src/owl/commands/commandlist.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# Written by JasonMo on 2023.06.02
22
# Copyright (c) 2021-2025 JasonMo All Rights Reserved
33

4-
commandlist = {"exit" : "commands.progress_exit.owl_exit(inptcommand)", "cd" : "special command", "ls" : "commands.file_operation.owl_ls(path, inptcommand)", 'mkdir' : 'commands.file_operation.owl_mkdir(path, inptcommand[1])', 'mkfile' : 'commands.file_operation.owl_mkfile(path, inptcommand[1])'}
4+
commandlist = {"exit" : "commands.progress_exit.owl_exit(inptcommand)", \
5+
"cd" : "special command", \
6+
"ls" : "commands.file_operation.owl_ls(path, inptcommand)", \
7+
'mkdir' : 'commands.file_operation.owl_mkdir(path, inptcommand[1])', \
8+
'mkfile' : 'commands.file_operation.owl_mkfile(path, inptcommand[1])', \
9+
'owldbg_err' : 'special command'}

src/owl/owl.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ def shellmain(self):
4242
path = commands.file_operation.owl_cd(path, inptcommand[1])
4343
print("")
4444

45+
elif inptcommand[0] == 'owldbg_err':
46+
owl_errors(int(inptcommand[1]))
47+
4548
else:
4649
runcommand = commandlist[inptcommand[0]]
4750
eval(runcommand)

src/owl/owl_errors.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,28 @@
11
# Written by JasonMo on 2023.05.30
22
# Copyright (c) 2021-2025 JasonMo All Rights Reserved
33

4+
import time
5+
46
def owl_errors(errnum:int):
57
if errnum == 000:
6-
print("\n \033[31mOwl shell error 000: Command not exists\033[0m\n")
8+
message = ("\n \033[31mOwl shell error 000: Command not exists\033[0m\n")
79

810
elif errnum == 200:
9-
print("\n \033[31mOwl shell error 200: Path not exists\033[0m")
11+
message = ("\n \033[31mOwl shell error 200: Path not exists\033[0m\n")
1012

1113
elif errnum == 201:
12-
print("\n \033[31mOwl shell error 201: Path not exists\033[0m")
14+
message = ("\n \033[31mOwl shell error 201: Path not exists\033[0m\n")
15+
16+
else:
17+
message = ("\n \033[33mOwl shell error "+str(errnum)+": Unknown error\033[0m\n")
18+
19+
print(message)
20+
owl_error_cache(message)
21+
22+
23+
def owl_error_cache(message):
24+
errcache = open('cache\\feedback.txt', 'a')
25+
errcache.write("\""+time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())+message+"\"")
26+
errcache.close
27+
1328

0 commit comments

Comments
 (0)