diff --git a/package/__init__.py b/package/__init__.py index 37cb1e2..fb4fffd 100644 --- a/package/__init__.py +++ b/package/__init__.py @@ -9,9 +9,8 @@ logging.basicConfig(level=logging.INFO) log = logging.getLogger('init') log.info('Progressbar/Logging ready.') - # Path Constants -ROOT = os.path.dirname(os.path.realpath(__file__)) +ROOT = os.getcwd() INPUT_PATH = ROOT TEMP_PATH = os.path.join(ROOT, 'temp') OUTPUT_PATH = os.path.join(ROOT, 'output') diff --git a/package/__main__.py b/package/__main__.py index 0cf84d7..f7be037 100644 --- a/package/__main__.py +++ b/package/__main__.py @@ -1,13 +1,20 @@ +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(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) \ No newline at end of file +# 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() \ No newline at end of file diff --git a/package/cli.py b/package/cli.py new file mode 100644 index 0000000..02a2541 --- /dev/null +++ b/package/cli.py @@ -0,0 +1,12 @@ +import logging +import click +import os +from .app import run +from . import ROOT, INPUT_PATH, OUTPUT_PATH, TEMP_PATH + +@click.command() +def cli(): + print('\n'.join([os.getcwd(), ROOT, INPUT_PATH, OUTPUT_PATH, TEMP_PATH])) + print('Executing phototag service') + run() + print('Phototag service executed') \ No newline at end of file diff --git a/phototag.py b/phototag.py deleted file mode 100644 index 4812820..0000000 --- a/phototag.py +++ /dev/null @@ -1,20 +0,0 @@ -import sys -import os -import logging -import click -from package import app - -log = logging.getLogger('main') - -os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = os.path.join( - sys.path[0], 'package', 'key', 'photo_tagging_service.json') - - -@click.command() -def cli(): - log.info('Executing package...') - sys.exit(app.run()) - - -if __name__ == "__main__": - main() diff --git a/setup.py b/setup.py index 66d763b..71be0ff 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,17 @@ import os import io from setuptools import find_packages, setup -DEPENDENCIES = ['Click'] +DEPENDENCIES = [ + 'Click', + 'rawpy', + 'imageio', + 'progressbar2', + 'iptcinfo3', + 'google-api-python-client', + 'google-cloud', + 'google-cloud-vision', + 'Pillow' +] EXCLUDE_FROM_PACKAGES = [] CURDIR = sys.path[0] @@ -25,7 +35,7 @@ setup( scripts=[], entry_points=''' [console_scripts] - phototag=phototag.phototag:cli + phototag=package.cli:cli ''', zip_safe=False, install_requires=DEPENDENCIES, @@ -37,4 +47,4 @@ setup( "Programming Language :: Python :: 3", "Operating System :: OS Independent", ], -) \ No newline at end of file +)