From 746a3969020d8b479906eaecfbee01d6a9a9335a Mon Sep 17 00:00:00 2001 From: harmacist Date: Sat, 27 Mar 2021 01:27:57 -0500 Subject: [PATCH] Added filepath to returned json info --- GlowstoneBlock.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/GlowstoneBlock.py b/GlowstoneBlock.py index 1a2b63f..911db1d 100644 --- a/GlowstoneBlock.py +++ b/GlowstoneBlock.py @@ -8,7 +8,9 @@ import logging def get_mod_info(target_file): with zipfile.ZipFile(target_file) as z: info_files = [f for f in z.filelist if not f.is_dir() and '.info' in f.filename.lower()] - return json.loads(z.read(info_files[0]))[0] + rtn_json = json.loads(z.read(info_files[0]))[0] + rtn_json['path'] = target_file + return rtn_json def get_modpack_info(target_dir): @@ -45,4 +47,4 @@ def main(directory='.'): if __name__ == "__main__": args = {arg.lower(): val for arg, val in (a[2:].split('=') for a in sys.argv if '--' in a.lower())} - main(r"C:\Users\VY Canis Majoris\OneDrive\Games\Minecraft\Modded Packs\1.12\1.12.2\Sinkhole") + main(r"C:\Users\VY Canis Majoris\AppData\Roaming\.moddedminecraft\1.12\1.12.2\Sinkhole\mods")