diff options
author | Matthias Baumgartner <dev@igsor.net> | 2023-03-04 15:19:43 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2023-03-04 15:19:43 +0100 |
commit | 02002942a3ea0172538ce3e9a636ea4a089ba870 (patch) | |
tree | f47772f2af83ef64676f5bc540701c14012eeec8 /tagit | |
parent | 1cb068b4c26b8262247886ee3e5e8935bc95f09d (diff) | |
download | tagit-02002942a3ea0172538ce3e9a636ea4a089ba870.tar.gz tagit-02002942a3ea0172538ce3e9a636ea4a089ba870.tar.bz2 tagit-02002942a3ea0172538ce3e9a636ea4a089ba870.zip |
integrate tagit script into bsfs.apps
Diffstat (limited to 'tagit')
-rw-r--r-- | tagit/apps/__init__.py | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/tagit/apps/__init__.py b/tagit/apps/__init__.py index 4c64128..6b4986c 100644 --- a/tagit/apps/__init__.py +++ b/tagit/apps/__init__.py @@ -1,10 +1,51 @@ -""" +#!/usr/bin/env python3 +"""The tagit applications. Part of the tagit module. A copy of the license is provided with the project. Author: Matthias Baumgartner, 2022 """ +# standard imports +import argparse +import typing + +# tagit imports +import tagit + # inner-module imports from .desktop import main as desktop +# exports +__all__: typing.Sequence[str] = ( + 'desktop', + ) + +# config +apps = { + 'desktop' : desktop, + } + + +## code ## + +def main(argv=None): + """The BSFS browser, focused on image tagging.""" + parser = argparse.ArgumentParser(description=main.__doc__, prog='tagit') + # version + parser.add_argument('--version', action='version', + version='%(prog)s {}.{}.{}'.format(*tuple(tagit.version_info))) # pylint: disable=C0209 + # 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 + apps[args.app](args.rest) + +if __name__ == '__main__': + import sys + main(sys.argv[1:]) + ## EOF ## |