From a413f8ce5e2c09494ff65fcc8bb1946dc2ba6410 Mon Sep 17 00:00:00 2001 From: lukas Date: Tue, 18 Jul 2023 16:59:44 +0200 Subject: [PATCH] [Style] Change filename of generated static .json files --- generate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/generate.py b/generate.py index 2d0446d..31f5e38 100644 --- a/generate.py +++ b/generate.py @@ -1,6 +1,6 @@ __author__ = "Lukas Mahler" __version__ = "1.0.0" -__date__ = "12.07.2023" +__date__ = "18.07.2023" __email__ = "m@hler.eu" __status__ = "Production" @@ -15,7 +15,7 @@ def main(): """ Generate static .json files, this is different from the original typescript repository. I like this .json format more for accessing the seeds later. - e.g. static_data['AWP][42]['percentage'] where 42 is the seed. + e.g. ['AWP]['42']['percentage'] where 42 is the seed. """ # Create instances of the calculators @@ -24,7 +24,7 @@ def main(): acid_calc = AcidFadeCalculator() # Build a new dict using format [WEAPON][SEED] = seed, percentage, ranking - for calc, name in [(fade_calc, 'fade'), (amber_calc, 'amber'), (acid_calc, 'acid')]: + for calc, name in [(fade_calc, 'fade'), (amber_calc, 'fade_amber'), (acid_calc, 'fade_acid')]: rebuild = {} for obj in calc.get_all_fade_percentages(): rebuild[obj.weapon] = {} @@ -36,7 +36,7 @@ def main(): } # dump the new dicts to a json file using 4 indents under ./generated - with open(f"./generated/{name}-percentages.json", 'w') as jf: + with open(f"./generated/{name}.json", 'w') as jf: json.dump(rebuild, jf, indent=4)