Food | A package manager based on Python, for Python.

wow im an idiot

wish13yt 14ae9547 9a8e4d2a

Changed files
+14 -12
src
+3 -3
src/cook.py
··· 7 7 with urllib.request.urlopen("https://food.freakybob.site/autumn/cook.json") as url: 8 8 data = json.load(url) 9 9 print("Packages fetched! [autumn, cook.json]") 10 - if (args.i in data["pypackages"]): 10 + if (args.t in data["pypackages"]): 11 11 print("Package found!") 12 12 urllib.request.urlretrieve( 13 - "https://food.freakybob.site/packages/python/" + args.i + ".py", args.i + ".py" 13 + "https://food.freakybob.site/packages/python/" + args.t + ".py", args.t + ".py" 14 14 ) 15 15 print("Package downloaded!") 16 16 print("The package will now run.") 17 17 print("-----") 18 - with open(args.i + ".py") as file: 18 + with open(args.t + ".py") as file: 19 19 exec(file.read()) 20 20 try: 21 21 os.remove(args.t + ".py")
+11 -9
src/food.py
··· 1 1 import argparse 2 2 import eat 3 + import cook 3 4 helpstring = """ 4 5 here's an example of downloading a python app: python3 food.py --i greg --type text 5 6 here's an example of downloading a text file: python3 food.py --i greg --type python 6 7 formatting: [your python name, ex: python3 or py] food.py --i [packagename] --[type] [python or text]""" 7 8 parser = argparse.ArgumentParser(prog='Food', description='A package manager in Python', epilog=helpstring) 8 9 parser.add_argument('--i') 9 - #parser.add_argument('--t') - coming soon once again 10 + parser.add_argument('--t') 10 11 parser.add_argument('--type') 11 12 args = parser.parse_args() 12 - if args.py: 13 - if args.type == "python": 14 - print("using python downloads") 15 - eat.python(args) 16 - if args.txt: 17 - if args.type == "text": 18 - print("using txt downloads") 19 - eat.txt(args) 13 + if args.type == "python": 14 + print("using python downloads") 15 + eat.python(args) 16 + if args.type == "text": 17 + print("using txt downloads") 18 + eat.txt(args) 19 + if args.t: 20 + print("using temp downloads; python") 21 + cook.cookpy(args)