From 0afa5994082416a34be013d3e7e4be7010b5d6b3 Mon Sep 17 00:00:00 2001 From: justuser31 Date: Tue, 30 Apr 2024 16:09:46 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B1=D0=B5=D0=BB=D1=8B=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=82=D0=B0=D0=B1=D1=8B,=20=D0=BC=D0=B5=D0=BB?= =?UTF-8?q?=D0=BA=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reworked/parse.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/reworked/parse.py b/reworked/parse.py index 6b78da6..e50f348 100644 --- a/reworked/parse.py +++ b/reworked/parse.py @@ -17,15 +17,15 @@ def parse_ftl(url = 'https://raw.githubusercontent.com/SerbiaStrong-220/space-st locales[name] = locale return locales -def load_recipe(yml = parse_yml()): - recipes = {} - for element in yml: - category = "medicine" - product = element["id"] - comps = {} - for elem in element["reactants"]: - comps[elem] = element["reactants"][elem]["amount"] - for id, value in element["products"].items(): - out = value - recipes[product] = reag__(category=category, comps=comps, out=out) - return recipes +def load_recipes(url = 'https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/Resources/Prototypes/Recipes/Reactions/medicine.yml', category = '-'): + yml = parse_yml(url) + recipes = {} + for element in yml: + product = element["id"] + comps = {} + for elem in element["reactants"]: + comps[elem] = element["reactants"][elem]["amount"] + for id, value in element["products"].items(): + out = value + recipes[product] = reag__(category=category, comps=comps, out=out) + return recipes