Merge branch 'main' into main

This commit is contained in:
OusmBlueNinja 2023-08-26 21:54:26 -05:00 committed by GitHub
commit c078a94931
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 14 additions and 11 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
\__pycache__ \__pycache__
pakk.conf pakk.conf
.pyc

View File

@ -6,7 +6,8 @@ from inspect import isfunction
import random import random
import time import time
import ast import ast
#import readline if os.name != "nt":
import readline
import threading import threading
@ -158,7 +159,7 @@ class packagemanager:
print(f"\n{color.green}Success:{color.white} Successfully installed {name}.") print(f"\n{color.green}Success:{color.white} Successfully installed {name}.")
except Exception as e: except Exception as e:
raise Exception(e) raise Exception(f"{color.red}{e}")

View File

@ -94,7 +94,7 @@ def ll(args):
file_stat = entry.stat() file_stat = entry.stat()
file_name = entry.name file_name = entry.name
if os.name != 'nt':
pw = pwd.getpwuid(file_stat.st_uid) pw = pwd.getpwuid(file_stat.st_uid)
gr = grp.getgrgid(file_stat.st_gid) gr = grp.getgrgid(file_stat.st_gid)

View File

@ -4,17 +4,18 @@ import os, sys
def pip(command: list): def pip(command: list):
print(command, len(command)) #print(command, len(command))
if len(command) != 1: if len(command) != 1:
print("comand requires [ package_name ] [ args (optional) ] ") print("comand requires [ package_name ] [ args (optional) ] ")
return return
package = command[0] package = command[0]
try: try:
from pip._internal import main as pipmain print("Running pip from shell")
pipmain(['install', {package}]) os.system(f"python -m pip install {package}")
except ImportError: except Exception as e:
os.system(f"pip install {package}") print(e)
except: except:
print("cannot download") print("cannot download")