diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:24:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:24:48 +0000 |
commit | cca66b9ec4e494c1d919bff0f71a820d8afab1fa (patch) | |
tree | 146f39ded1c938019e1ed42d30923c2ac9e86789 /share/extensions/other/inkman/manage_extensions.py | |
parent | Initial commit. (diff) | |
download | inkscape-cca66b9ec4e494c1d919bff0f71a820d8afab1fa.tar.xz inkscape-cca66b9ec4e494c1d919bff0f71a820d8afab1fa.zip |
Adding upstream version 1.2.2.upstream/1.2.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | share/extensions/other/inkman/manage_extensions.py | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/share/extensions/other/inkman/manage_extensions.py b/share/extensions/other/inkman/manage_extensions.py new file mode 100755 index 0000000..41494c7 --- /dev/null +++ b/share/extensions/other/inkman/manage_extensions.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright 2018 Martin Owens <doctormo@gmail.com> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/> +# +""" +Inkscape Extensions Manager, Graphical User Interface (Gtk3) +""" + +import os +import sys +import logging +import warnings +warnings.filterwarnings("ignore") + +from inkex import gui + +from argparse import ArgumentParser + + +def run(args): + # Late imports to catch import errors. + from inkman.targets import TARGETS + from inkman.gui import ManagerApp + from inkman.utils import get_inkscape_version + + arg_parser = ArgumentParser(description=__doc__) + arg_parser.add_argument("input_file", nargs="?") + arg_parser.add_argument( + "--target", default=TARGETS[0].category, choices=[t.category for t in TARGETS] + ) + arg_parser.add_argument("--for-version", default=None) + options = arg_parser.parse_args(args) + version = options.for_version or get_inkscape_version() + try: + ManagerApp( + start_loop=True, + version=version, + target=[t for t in TARGETS if t.category == options.target][0], + ) + except KeyboardInterrupt: + logging.error("User Interputed") + logging.debug("Exiting Application") + + +def recovery_run(args): + try: + run(args) + except Exception: + from inkman.backfoot import attempt_to_recover + + attempt_to_recover() + + +if __name__ == "__main__": + recovery_run(sys.argv[1:]) |