fixed upd/update
This commit is contained in:
parent
b19dd70023
commit
6c1676da18
@ -1 +1 @@
|
|||||||
[['builtin', 'packages.builtin', ['echo', 'ls', 'rm', 'clear', 'cd', 'll']]]
|
[['builtin', 'packages.builtin', ['echo', 'ls', 'rm', 'clear', 'cd', 'll']], ['upd', 'packages.update', ['upd']]]
|
@ -1,22 +1,23 @@
|
|||||||
# -*- coding: utf-8 -*-
|
#["upd", "packages.update", ["upd"]]
|
||||||
#["pip", "packages.pip", ["pip"]]
|
|
||||||
# Made By Blurple
|
# Made By Blurple
|
||||||
import os, sys
|
import os, sys, requests
|
||||||
|
|
||||||
|
fileList = [
|
||||||
|
"https://raw.githubusercontent.com/OusmBlueNinja/TermPY/main/packages/builtin.py",
|
||||||
|
"https://raw.githubusercontent.com/OusmBlueNinja/TermPY/main/packages/echo.py",
|
||||||
|
"https://raw.githubusercontent.com/OusmBlueNinja/TermPY/main/packages/nano.py",
|
||||||
|
"https://raw.githubusercontent.com/OusmBlueNinja/TermPY/main/packages/netget.py",
|
||||||
|
"https://raw.githubusercontent.com/OusmBlueNinja/TermPY/main/packages/pip.py",
|
||||||
|
"https://raw.githubusercontent.com/OusmBlueNinja/TermPY/main/packages/upd.py"
|
||||||
|
]
|
||||||
|
|
||||||
def pip(command: list):
|
def upd(command):
|
||||||
|
input(f"Settings: {fileList}, {os.path.dirname(os.path.realpath(__file__))}\nPress enter to continue")
|
||||||
print(command, len(command))
|
for url in fileList:
|
||||||
if len(command) != 1:
|
r = requests.get(url)
|
||||||
print("comand requires [ package_name ] [ args (optional) ] ")
|
if 'Requests:' in r.text:
|
||||||
return
|
print(r.text)
|
||||||
|
print(r.headers['Content-Type'])
|
||||||
package = command[0]
|
fileInstallingCreator = os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.basename(url))
|
||||||
try:
|
with open(fileInstallingCreator, "w") as newFile:
|
||||||
from pip._internal import main as pipmain
|
newFile.write(r.text)
|
||||||
pipmain(['install', {package}])
|
|
||||||
except ImportError:
|
|
||||||
os.system(f"pip install {package}")
|
|
||||||
|
|
||||||
except:
|
|
||||||
print("cannot download")
|
|
||||||
|
Loading…
Reference in New Issue
Block a user