From 7fd5bbe3c7ea8549c548cbcd6b0c26e411ba54e6 Mon Sep 17 00:00:00 2001 From: harmacist Date: Fri, 26 Mar 2021 23:54:34 -0500 Subject: [PATCH] Initial commit --- .gitignore | 4 ++-- GlowstoneBlock.py | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 GlowstoneBlock.py diff --git a/.gitignore b/.gitignore index 74c64a3..86d6d71 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -venv\ -.idea\ +venv +.idea *.jar \ No newline at end of file diff --git a/GlowstoneBlock.py b/GlowstoneBlock.py new file mode 100644 index 0000000..5a6fd8f --- /dev/null +++ b/GlowstoneBlock.py @@ -0,0 +1,23 @@ +import zipfile +import json +import os + + +def get_mod_info(target_file): + with zipfile.ZipFile(target_file) as z: + return json.loads(z.read('mcmod.info'))[0] + + +def get_modpack_info(target_dir): + for f in os.scandir(target_dir): + if f.is_file(): + if '.jar' in f.name.lower(): + yield get_mod_info(f.path) + + +def main(): + pass + + +if __name__ == "__main__": + main()