From 5d433451469149beae56e482ff42a0d7a7c76ba8 Mon Sep 17 00:00:00 2001 From: Matthias Baumgartner Date: Fri, 6 Jan 2023 11:58:30 +0100 Subject: main app --- tagit.app | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 tagit.app diff --git a/tagit.app b/tagit.app new file mode 100644 index 0000000..e18bbc0 --- /dev/null +++ b/tagit.app @@ -0,0 +1,42 @@ +#!/usr/bin/python3.6 +"""The tagit application. + +Part of the tagit module. +A copy of the license is provided with the project. +Author: Matthias Baumgartner, 2022 +""" +# imports +import argparse +import sys + +# module imports +import tagit +import tagit.apps + +# config +apps = { + 'desktop' : tagit.apps.desktop, + } + + +## code ## + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Image tagger tool.', prog='tagit') + # version + parser.add_argument('--version', action='version', + version='%(prog)s {}.{}.{}'.format(*tuple(tagit.version_info))) + # application selection + parser.add_argument('app', choices=apps.keys(), nargs='?', default='desktop', + help='Select the application to run.') + # dangling args + parser.add_argument('rest', nargs=argparse.REMAINDER) + # parse + args = parser.parse_args() + # run application + try: + apps[args.app](args.rest) + except Exception as e: + print(str(e)) + +## EOF ## -- cgit v1.2.3