add docstrings to remaining files, delete unneeded __main__ and fix up small comments/code formatting in app/process

This commit is contained in:
Xevion
2020-08-27 00:16:41 -05:00
parent 33e87000b7
commit a14a377251
4 changed files with 19 additions and 20 deletions

View File

@@ -1,20 +0,0 @@
import sys
import os
import logging
from .app import main
from . import INPUT_PATH, OUTPUT_PATH
# Ensure that 'input' and 'output' directories are created
# if not os.path.exists(INPUT_PATH):
# logging.fatal('Input directory did not exist, creating and quitting.')
# os.makedirs(INPUT_PATH)
# if not os.path.exists(OUTPUT_PATH):
# logging.info('Output directory did not exist. Creating...')
# os.makedirs(OUTPUT_PATH)
log = logging.getLogger("main")
if __name__ == "__main__":
main()

View File

@@ -1,3 +1,9 @@
"""
app.py
Main app function file for running the program, delegating the tagging operations to different threads.
"""
import logging
import os
from threading import Thread

View File

@@ -1,3 +1,9 @@
"""
process.py
Holds the FileProcessor object, used for working with images in order to label and edit/tag their metadata.
"""
import io
import logging
import os
@@ -120,6 +126,7 @@ class FileProcessor(object):
info = iptcinfo3.IPTCInfo(os.path.join(INPUT_PATH, self.file_name))
info["keywords"].extend(labels)
info.save()
# Remove the weird ghost file created by this iptc read/writer.
os.remove(os.path.join(INPUT_PATH, self.file_name + "~"))

View File

@@ -1,3 +1,9 @@
"""
xmp.py
Holds a helper class for working with .xmp files and adding keywords to the file.
"""
import xml.etree.ElementTree as ET
# Constant Namespace Types