From 86ea8ba4fa79ccfa4d09b6f81ce7c17e5572e1b6 Mon Sep 17 00:00:00 2001 From: elburg Date: Sun, 5 Feb 2023 13:58:50 -0800 Subject: [PATCH] oops readded main.py moved some stuff from xmp to deviantart --- category/deviantart.py | 6 ++++-- main.py | 22 ++++++++++++++++++++++ standards/xmp.py | 2 +- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 main.py diff --git a/category/deviantart.py b/category/deviantart.py index 9aac679..fa1cf02 100644 --- a/category/deviantart.py +++ b/category/deviantart.py @@ -12,6 +12,8 @@ def makeKeyWordList(tags): output.append('is_mature') - for item in .get(tags.category_path,[]): + for item in catPaths.get(tags.category_path,[]): output.append(item) - \ No newline at end of file + + for item in tags.category_path.split('/'): + output.append(item) \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..60b87bf --- /dev/null +++ b/main.py @@ -0,0 +1,22 @@ +# module imports +import sys +import json +import logging + +# init logging +logging.basicConfig(stream=sys.stderr, level=logging.DEBUG) + +# variable init +infojson={} +source=sys.argv[1] + +logging.info(f"loading info.json for {source}...") +with open(f"{source}.json") as file: + infojson=json.load(file) + +# TODO: insert method to check url or dict +logging.debug("determining file type...") +from standards import exif +if infojson.extension in exif.allowed_exts: + logging.debug(f"exif module supports {infojson.extesnion} files. using it... ") + \ No newline at end of file diff --git a/standards/xmp.py b/standards/xmp.py index ca6f3aa..7f5fc27 100644 --- a/standards/xmp.py +++ b/standards/xmp.py @@ -122,6 +122,6 @@ def writeTags(file, tags): from ..category.furaffinity import makeKeyWordList for item in makeKeyWordList(tags): if item not in keywords: keywords.append(item) - + \ No newline at end of file