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

3
.gitignore vendored
View File

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

View File

@ -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}")

View File

@ -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] == '.')

View File

@ -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")