oops readded main.py

moved some stuff from xmp to deviantart
This commit is contained in:
elburg 2023-02-05 13:58:50 -08:00
parent e15437252e
commit 86ea8ba4fa
3 changed files with 27 additions and 3 deletions

View file

@ -12,6 +12,8 @@ def makeKeyWordList(tags):
output.append('is_mature') output.append('is_mature')
for item in .get(tags.category_path,[]): for item in catPaths.get(tags.category_path,[]):
output.append(item) output.append(item)
for item in tags.category_path.split('/'):
output.append(item)

22
main.py Normal file
View file

@ -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... ")

View file

@ -122,6 +122,6 @@ def writeTags(file, tags):
from ..category.furaffinity import makeKeyWordList from ..category.furaffinity import makeKeyWordList
for item in makeKeyWordList(tags): for item in makeKeyWordList(tags):
if item not in keywords: keywords.append(item) if item not in keywords: keywords.append(item)