diff --git a/category/deviantart.py b/category/deviantart.py deleted file mode 100644 index 9aac679..0000000 --- a/category/deviantart.py +++ /dev/null @@ -1,17 +0,0 @@ -def makeKeyWordList(tags): - catPaths = { - 'digitalart/paintings/other': ['Digital Art', 'Paintings'] - } - output = [ - tags.da_category, - tags.license, - tags.author.username - ] - - if tags.is_mature: - output.append('is_mature') - - - for item in .get(tags.category_path,[]): - output.append(item) - \ No newline at end of file diff --git a/category/furaffinity.py b/category/furaffinity.py deleted file mode 100644 index b01bf98..0000000 --- a/category/furaffinity.py +++ /dev/null @@ -1,9 +0,0 @@ -def makeKeyWordList(tags): - return [ - tags.theme, - tags.rating, - tags.species, - tags.gender, - tags.artist_url, - tags.fa_category - ] \ No newline at end of file diff --git a/standards/exif.py b/exif.py similarity index 100% rename from standards/exif.py rename to exif.py diff --git a/misc/getpub.py b/getpub.py similarity index 100% rename from misc/getpub.py rename to getpub.py diff --git a/standards/iptc.py b/iptc.py similarity index 100% rename from standards/iptc.py rename to iptc.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..1668ade --- /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...") +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/matroska.py b/matroska.py similarity index 100% rename from standards/matroska.py rename to matroska.py diff --git a/standards/png.py b/png.py similarity index 100% rename from standards/png.py rename to png.py diff --git a/standards/xmp.py b/xmp.py similarity index 84% rename from standards/xmp.py rename to xmp.py index ca6f3aa..ba9cb18 100644 --- a/standards/xmp.py +++ b/xmp.py @@ -102,26 +102,22 @@ def writeTags(file, tags): if date in tags: xmptags['Xmp.dc.date'] = tags.date - from ..misc.getpub import getPub + from getpub import getPub xmptags['Xmp.dc.publisher'] = getPub(tags) del getPub keywords=[] - keywords.append(tags.category) + if tags in tags: for item in tags.tags: if item not in keywords: keywords.append(item) - if tags in tags: - for item in tags.tags: - if item not in keywords: keywords.append(item) + if theme in tags and tags.theme not in keywords: + keywords.append(tags.theme) - if tags.category == 'deviantart': - from ..category.deviantart import makeKeyWordList - for item in makeKeyWordList(tags): - if item not in keywords: keywords.append(item) - elif tags.category == 'furaffinity': - from ..category.furaffinity import makeKeyWordList - for item in makeKeyWordList(tags): - if item not in keywords: keywords.append(item) - - - \ No newline at end of file + if rating in tags and tags.rating not in keywords: + keywords.append(tags.rating) + + if species in tags and tags.species not in keywords: + keywords.append(tags.species) + + if gender in tags and tags.gender not in keywords: + keywords \ No newline at end of file