mirror of
https://github.com/Xevion/phototag.git
synced 2025-12-09 22:07:56 -06:00
add docstrings to remaining files, delete unneeded __main__ and fix up small comments/code formatting in app/process
This commit is contained in:
@@ -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()
|
||||
@@ -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
|
||||
|
||||
@@ -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 + "~"))
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user