modified: packages/pakk.conf

modified:   packages/update.py
This commit is contained in:
OusmBlueNinja 2023-08-26 22:56:36 -05:00
parent 6c1676da18
commit 316c5c5eae
2 changed files with 19 additions and 9 deletions

View File

@ -1 +1 @@
[['builtin', 'packages.builtin', ['echo', 'ls', 'rm', 'clear', 'cd', 'll']], ['upd', 'packages.update', ['upd']]] [['builtin', 'packages.builtin', ['echo', 'ls', 'rm', 'clear', 'cd', 'll']], ['upd', 'packages.update', ['upd']], ['pip', 'packages.pip', ['pip']]]

View File

@ -1,6 +1,6 @@
#["upd", "packages.update", ["upd"]] #["upd", "packages.update", ["upd"]]
# Made By Blurple # Made By Blurple
import os, sys, requests import os, sys, requests, threading
fileList = [ fileList = [
"https://raw.githubusercontent.com/OusmBlueNinja/TermPY/main/packages/builtin.py", "https://raw.githubusercontent.com/OusmBlueNinja/TermPY/main/packages/builtin.py",
@ -11,13 +11,23 @@ fileList = [
"https://raw.githubusercontent.com/OusmBlueNinja/TermPY/main/packages/upd.py" "https://raw.githubusercontent.com/OusmBlueNinja/TermPY/main/packages/upd.py"
] ]
def download_and_save(url):
r = requests.get(url)
if 'Requests:' in r.text:
print(r.text)
print(r.headers['Content-Type'])
fileInstallingCreator = os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.basename(url))
with open(fileInstallingCreator, "w") as newFile:
newFile.write(r.text)
def upd(command): def upd(command):
input(f"Settings: {fileList}, {os.path.dirname(os.path.realpath(__file__))}\nPress enter to continue") input(f"Settings: {fileList}, {os.path.dirname(os.path.realpath(__file__))}\nPress enter to continue")
threads = []
for url in fileList: for url in fileList:
r = requests.get(url) thread = threading.Thread(target=download_and_save, args=(url,))
if 'Requests:' in r.text: threads.append(thread)
print(r.text) thread.start()
print(r.headers['Content-Type'])
fileInstallingCreator = os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.basename(url)) for thread in threads:
with open(fileInstallingCreator, "w") as newFile: thread.join()
newFile.write(r.text)