fixed windows commands
This commit is contained in:
parent
d3aaefaffd
commit
08791e3b47
7
main.py
7
main.py
@ -51,9 +51,10 @@ def getPrompt():
|
||||
path = os.getcwd()
|
||||
|
||||
# Set up tab completion for file and directory names
|
||||
completer = readline.get_completer()
|
||||
readline.set_completer_delims(' \t\n')
|
||||
readline.parse_and_bind("tab: complete")
|
||||
if os.name != "nt":
|
||||
completer = readline.get_completer()
|
||||
readline.set_completer_delims(' \t\n')
|
||||
readline.parse_and_bind("tab: complete")
|
||||
|
||||
prompt = color.white + "┌ " + color.green + username + color.white + ":" + color.blue + path + color.white + "\n└ $ "
|
||||
return prompt
|
||||
|
@ -1,8 +1,10 @@
|
||||
#["builtin", "packages.builtin", ["echo", "ls", "rm", "clear", "cd", "ll"]]
|
||||
import os
|
||||
import stat
|
||||
import pwd
|
||||
import grp
|
||||
|
||||
if os.name != 'nt':
|
||||
import pwd
|
||||
import grp
|
||||
import time
|
||||
|
||||
|
||||
@ -75,7 +77,9 @@ def ls(args):
|
||||
|
||||
|
||||
def ll(args):
|
||||
del args
|
||||
if os.name != 'nt':
|
||||
print("This command only works for linux")
|
||||
return
|
||||
dir_path = os.getcwd()
|
||||
|
||||
green_color = '\033[32m'
|
||||
@ -89,6 +93,7 @@ def ll(args):
|
||||
for entry in entries:
|
||||
file_stat = entry.stat()
|
||||
file_name = entry.name
|
||||
|
||||
|
||||
pw = pwd.getpwuid(file_stat.st_uid)
|
||||
gr = grp.getgrgid(file_stat.st_gid)
|
||||
|
Loading…
Reference in New Issue
Block a user