diff --git a/.gitignore b/.gitignore index 4311f65..db0e7f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ \__pycache__ -pakk.conf \ No newline at end of file +pakk.conf +.pyc diff --git a/main.py b/main.py index 8469bc1..3c4f999 100644 --- a/main.py +++ b/main.py @@ -6,7 +6,8 @@ from inspect import isfunction import random import time import ast -#import readline +if os.name != "nt": + import readline import threading @@ -158,7 +159,7 @@ class packagemanager: print(f"\n{color.green}Success:{color.white} Successfully installed {name}.") except Exception as e: - raise Exception(e) + raise Exception(f"{color.red}{e}") diff --git a/packages/__pycache__/builtin.cpython-310.pyc b/packages/__pycache__/builtin.cpython-310.pyc deleted file mode 100644 index a6f5181..0000000 Binary files a/packages/__pycache__/builtin.cpython-310.pyc and /dev/null differ diff --git a/packages/__pycache__/builtin.cpython-311.pyc b/packages/__pycache__/builtin.cpython-311.pyc deleted file mode 100644 index 231d389..0000000 Binary files a/packages/__pycache__/builtin.cpython-311.pyc and /dev/null differ diff --git a/packages/__pycache__/echo.cpython-311.pyc b/packages/__pycache__/echo.cpython-311.pyc deleted file mode 100644 index 4a63689..0000000 Binary files a/packages/__pycache__/echo.cpython-311.pyc and /dev/null differ diff --git a/packages/__pycache__/nano.cpython-310.pyc b/packages/__pycache__/nano.cpython-310.pyc deleted file mode 100644 index 7cbaa86..0000000 Binary files a/packages/__pycache__/nano.cpython-310.pyc and /dev/null differ diff --git a/packages/__pycache__/netget.cpython-310.pyc b/packages/__pycache__/netget.cpython-310.pyc deleted file mode 100644 index fc19843..0000000 Binary files a/packages/__pycache__/netget.cpython-310.pyc and /dev/null differ diff --git a/packages/__pycache__/netget.cpython-311.pyc b/packages/__pycache__/netget.cpython-311.pyc deleted file mode 100644 index c2c5902..0000000 Binary files a/packages/__pycache__/netget.cpython-311.pyc and /dev/null differ diff --git a/packages/__pycache__/python.cpython-310.pyc b/packages/__pycache__/python.cpython-310.pyc deleted file mode 100644 index 9c688e6..0000000 Binary files a/packages/__pycache__/python.cpython-310.pyc and /dev/null differ diff --git a/packages/builtin.py b/packages/builtin.py index 6442cec..79f2a13 100644 --- a/packages/builtin.py +++ b/packages/builtin.py @@ -94,9 +94,9 @@ def ll(args): file_stat = entry.stat() file_name = entry.name - - pw = pwd.getpwuid(file_stat.st_uid) - gr = grp.getgrgid(file_stat.st_gid) + if os.name != 'nt': + pw = pwd.getpwuid(file_stat.st_uid) + gr = grp.getgrgid(file_stat.st_gid) is_hidden = (file_name and file_name[0] == '.') diff --git a/packages/pip.py b/packages/pip.py index 4b4d12b..c4f77fd 100644 --- a/packages/pip.py +++ b/packages/pip.py @@ -4,17 +4,18 @@ import os, sys def pip(command: list): - print(command, len(command)) + #print(command, len(command)) if len(command) != 1: print("comand requires [ package_name ] [ args (optional) ] ") return package = command[0] try: - from pip._internal import main as pipmain - pipmain(['install', {package}]) - except ImportError: - os.system(f"pip install {package}") + print("Running pip from shell") + os.system(f"python -m pip install {package}") + except Exception as e: + print(e) + except: print("cannot download") \ No newline at end of file