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 | |
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 '')
32 files changed, 3952 insertions, 0 deletions
diff --git a/share/extensions/other/inkman/MANIFEST.in b/share/extensions/other/inkman/MANIFEST.in new file mode 100644 index 0000000..cffd671 --- /dev/null +++ b/share/extensions/other/inkman/MANIFEST.in @@ -0,0 +1,6 @@ +include inkman/data/*.glade +include inkman/data/*.ui +include inkman/data/pixmaps/*.svg +include inkman/data/pixmaps/*.png +include manage-extensions.inx +include manage-extensions.py diff --git a/share/extensions/other/inkman/inkman/__init__.py b/share/extensions/other/inkman/inkman/__init__.py new file mode 100644 index 0000000..04089ba --- /dev/null +++ b/share/extensions/other/inkman/inkman/__init__.py @@ -0,0 +1,5 @@ +__pkgname__ = "inkscape-extension-manager" +__version__ = "1.0" +__issues__ = "https://gitlab.com/inkscape/extras/extension-manager/-/issues" +__state__ = f"({__version__})" +__inkscape__ = ["1.2"] diff --git a/share/extensions/other/inkman/inkman/archive.py b/share/extensions/other/inkman/inkman/archive.py new file mode 100644 index 0000000..abc1758 --- /dev/null +++ b/share/extensions/other/inkman/inkman/archive.py @@ -0,0 +1,120 @@ +# +# Copyright (c) Gary Wilson Jr. <gary@thegarywilson.com> and contributors. +# +# MIT License, see https://github.com/gdub/python-archive/blob/master/LICENSE.txt +# +""" +Compatability for zip and tar files, taken from upstream and stripped down +to provide list and read interface, removed PY2 support. +""" + +import os +import sys +import tarfile +import zipfile + + +class ArchiveException(Exception): + """Base exception class for all archive errors.""" + + +class UnrecognizedArchiveFormat(ArchiveException): + """Error raised when passed file is not a recognized archive format.""" + + +class Archive(object): + """ + The external API class that encapsulates an archive implementation. + """ + + def __init__(self, filename, ext=""): + """ + Arguments: + * 'file' can be a string path to a file or a file-like object. + * Optional 'ext' argument can be given to override the file-type + guess that is normally performed using the file extension of the + given 'file'. Should start with a dot, e.g. '.tar.gz'. + """ + cls = self._archive_cls(filename, ext=ext) + self._archive = cls(filename) + + def __enter__(self): + return self._archive + + def __exit__(self, exc, value, traceback): + pass + + @staticmethod + def _archive_cls(filename, ext=""): + """ + Return the proper Archive implementation class, based on the file type. + """ + cls = None + if not isinstance(filename, str): + try: + filename = filename.name + except AttributeError: + raise UnrecognizedArchiveFormat( + "File object not a recognized archive format." + ) + lookup_filename = filename + ext + base, tail_ext = os.path.splitext(lookup_filename.lower()) + cls = extension_map.get(tail_ext) + if not cls: + base, ext = os.path.splitext(base) + cls = extension_map.get(ext) + if not cls: + raise UnrecognizedArchiveFormat( + "Path not a recognized archive format: %s" % filename + ) + return cls + + +class BaseArchive(object): + def __del__(self): + if hasattr(self, "_archive"): + self._archive.close() + + def list(self): + raise NotImplementedError() + + def filenames(self): + raise NotImplementedError() + + +class TarArchive(BaseArchive): + def __init__(self, filename): + # tarfile's open uses different parameters for file path vs. file obj. + if isinstance(filename, str): + self._archive = tarfile.open(name=filename) + else: + self._archive = tarfile.open(fileobj=filename) + + def filenames(self): + return self._archive.getnames() + + def read(self, name): + return self._archive.extractfile(name).read() + + +class ZipArchive(BaseArchive): + def __init__(self, file): + # ZipFile's 'file' parameter can be path (string) or file-like obj. + self._archive = zipfile.ZipFile(file) + + def filenames(self): + return self._archive.namelist() + + def read(self, name): + return self._archive.read(name) + + +extension_map = { + ".egg": ZipArchive, + ".zip": ZipArchive, + ".tar": TarArchive, + ".tar.bz2": TarArchive, + ".tar.gz": TarArchive, + ".tgz": TarArchive, + ".tz2": TarArchive, +} diff --git a/share/extensions/other/inkman/inkman/backfoot.py b/share/extensions/other/inkman/inkman/backfoot.py new file mode 100644 index 0000000..42a7e69 --- /dev/null +++ b/share/extensions/other/inkman/inkman/backfoot.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Copyright 2021 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/> +# +""" +When the extension manager fails, this allows us to upgrade automatically. +""" + +import os +import sys +import traceback + +# Note: All imports are being done as late as possible in this module. +# If any of the imports caused the error, then we'll still message the user. + + +def update_pip_package(package): + """ + Update the package using the pip update. + """ + from inkex.utils import get_user_directory + from inkex.command import ProgramRunError, call + + try: + pip = os.path.join(get_user_directory(), "bin", "pip") + log = call(pip, "install", "--upgrade", package).decode("utf8") + logs = [line for line in log.split("\n") if "skip" not in line] + return "\n".join(logs) + except ProgramRunError as err: + raise IOError(f"Failed to update the package {package}") + + +def attempt_to_recover(): + """ + Messages the user, provides a traceback and attepts a self-update + """ + info = sys.exc_info() + sys.stderr.write("An error occured with the extensions manager!\n") + sys.stderr.write("Trying to self-update the package... ") + sys.stderr.flush() + + from inkman import __pkgname__, __version__, __file__, __issues__ + + location = os.path.dirname(__file__) + update_log = "Not done" + + try: + update_log = update_pip_package(__pkgname__) + sys.stderr.write("Updated!\n\nPlease try and reload the program again.\n\n") + except Exception: + sys.stderr.write( + "Failed to update!\n\nPlease delete the package manually! (see location below)\n\n" + ) + + sys.stderr.write( + f""" +Please report this error +------------------------ + +Report URL: {__issues__} +Location: {location} +{__pkgname__}: {__version__} + +{update_log} +""" + ) + + traceback.print_exception(*info) + del info + sys.exit(2) diff --git a/share/extensions/other/inkman/inkman/data/__init__.py b/share/extensions/other/inkman/inkman/data/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/share/extensions/other/inkman/inkman/data/__init__.py diff --git a/share/extensions/other/inkman/inkman/data/gui.ui b/share/extensions/other/inkman/inkman/data/gui.ui new file mode 100644 index 0000000..3462d25 --- /dev/null +++ b/share/extensions/other/inkman/inkman/data/gui.ui @@ -0,0 +1,736 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.22.2 + +Copyright (C) Martin Owens + +This file is part of Inkscape Extensions Manager. + +Inkscape Extensions Manager 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. + +Inkscape Extensions Manager 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 Inkscape Extensions Manager. If not, see <http://www.gnu.org/licenses/>. + +--> +<interface domain="inkscape-extensions-manager"> + <requires lib="gtk+" version="3.18"/> + <!-- interface-license-type gplv3 --> + <!-- interface-name Inkscape Extensions Manager --> + <!-- interface-description Download and manage inkscape extensions --> + <!-- interface-copyright Martin Owens --> + <object class="GtkDialog" id="dialog"> + <property name="can_focus">False</property> + <property name="type_hint">dialog</property> + <child type="titlebar"> + <placeholder/> + </child> + <child internal-child="vbox"> + <object class="GtkBox"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton"> + <property name="label">gtk-close</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + <property name="always_show_image">True</property> + <signal name="activate" handler="close_dialog" swapped="no"/> + <signal name="clicked" handler="close_dialog" swapped="no"/> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkImage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">20</property> + <property name="margin_right">15</property> + <property name="margin_top">10</property> + <property name="margin_bottom">10</property> + <property name="stock">gtk-dialog-error</property> + <property name="icon_size">6</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="dialog_msg"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">$message</property> + <property name="wrap">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + <object class="GtkFileFilter" id="filter-for-extensions"> + <mime-types> + <mime-type>application/x-bzip</mime-type> + <mime-type>application/x-bzip2</mime-type> + <mime-type>application/zip</mime-type> + </mime-types> + <patterns> + <pattern>*.zip</pattern> + <pattern>*.tar.bz2</pattern> + <pattern>*.tar.gz</pattern> + </patterns> + </object> + <object class="GtkImage" id="img_info"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-info</property> + </object> + <object class="GtkImage" id="img_install"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-add</property> + </object> + <object class="GtkImage" id="img_install1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-add</property> + </object> + <object class="GtkImage" id="img_install_zip"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-open</property> + </object> + <object class="GtkImage" id="img_uninstall"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-delete</property> + </object> + <object class="GtkImage" id="img_update"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-save</property> + </object> + <object class="GtkWindow" id="gui"> + <property name="can_focus">False</property> + <property name="title" translatable="yes">Inkscape Extensions</property> + <property name="window_position">center</property> + <property name="default_width">600</property> + <property name="default_height">400</property> + <property name="icon">pixmaps/icon.svg</property> + <child type="titlebar"> + <placeholder/> + </child> + <child> + <object class="GtkNotebook" id="main_notebook"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <child> + <object class="GtkBox" id="box_installed"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">3</property> + <child> + <object class="GtkBox" id="box_installed_padding"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkScrolledWindow"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkTreeView" id="local_extensions"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <child internal-child="selection"> + <object class="GtkTreeSelection"/> + </child> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="padding">4</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="padding">4</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox" id="buttons_installed"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">8</property> + <child> + <object class="GtkButton" id="local_uninstall"> + <property name="label">_Uninstall Package</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="image">img_uninstall</property> + <property name="use_underline">True</property> + <property name="always_show_image">True</property> + <signal name="activate" handler="local_uninstall" swapped="no"/> + <signal name="clicked" handler="local_uninstall" swapped="no"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="padding">4</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="update_all"> + <property name="label">Update All</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="image">img_update</property> + <property name="use_underline">True</property> + <property name="always_show_image">True</property> + <signal name="activate" handler="update_all" swapped="no"/> + <signal name="clicked" handler="update_all" swapped="no"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkSpinner" id="loading"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkButton" id="local_information"> + <property name="label">_Details</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_underline">True</property> + <property name="always_show_image">True</property> + <signal name="activate" handler="local_information" swapped="no"/> + <signal name="clicked" handler="local_information" swapped="no"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">3</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="padding">4</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="tab_expand">True</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Active Packages</property> + </object> + <packing> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">4</property> + <property name="margin_right">4</property> + <child> + <object class="GtkSearchEntry" id="dl-search"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="primary_icon_name">edit-find-symbolic</property> + <property name="primary_icon_activatable">False</property> + <property name="primary_icon_sensitive">False</property> + <signal name="activate" handler="remote_search" swapped="no"/> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkSpinner" id="dl-searching"> + <property name="name">searcher</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="events"/> + <property name="margin_left">4</property> + <property name="margin_right">4</property> + <property name="margin_top">4</property> + <property name="margin_bottom">4</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="padding">6</property> + <property name="pack_type">end</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="remote_getlist"> + <property name="label">gtk-refresh</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + <property name="always_show_image">True</property> + <signal name="activate" handler="remote_getlist" swapped="no"/> + <signal name="clicked" handler="remote_getlist" swapped="no"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="padding">4</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkButton" id="remote_info"> + <property name="label">Details and Comments</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="image">img_info</property> + <property name="use_underline">True</property> + <property name="always_show_image">True</property> + <signal name="activate" handler="remote_info" swapped="no"/> + <signal name="clicked" handler="remote_info" swapped="no"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="padding">4</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="remote_install"> + <property name="label">_Install Package</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_underline">True</property> + <property name="always_show_image">True</property> + <signal name="activate" handler="remote_install" swapped="no"/> + <signal name="clicked" handler="remote_install" swapped="no"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="padding">4</property> + <property name="pack_type">end</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkButton" id="local_install"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="image">img_install_zip</property> + <property name="always_show_image">True</property> + <signal name="activate" handler="local_install" swapped="no"/> + <signal name="clicked" handler="local_install" swapped="no"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="padding">4</property> + <property name="pack_type">end</property> + <property name="position">3</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="padding">4</property> + <property name="pack_type">end</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkInfoBar"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="message_type">error</property> + <child internal-child="action_area"> + <object class="GtkButtonBox"> + <property name="can_focus">False</property> + <property name="spacing">6</property> + <property name="layout_style">end</property> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child internal-child="content_area"> + <object class="GtkBox"> + <property name="can_focus">False</property> + <property name="spacing">16</property> + <child> + <object class="GtkImage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">10</property> + <property name="stock">gtk-dialog-warning</property> + <property name="icon_size">3</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes"><b>Online content!</b> All packages are peer-reviewed by volunteers in the Inkscape community, but this does not mean these packages are safe. <i>Only download and use extensions if you trust the author or peers and understand the risks of running this software.</i></property> + <property name="use_markup">True</property> + <property name="wrap">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkScrolledWindow" id="results_found"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="margin_left">4</property> + <property name="margin_right">4</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkTreeView" id="remote_extensions"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <child internal-child="selection"> + <object class="GtkTreeSelection"/> + </child> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox" id="no_results"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkImage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="yalign">1</property> + <property name="pixbuf">pixmaps/not-found.png</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">4</property> + <property name="margin_right">4</property> + <property name="margin_top">4</property> + <property name="margin_bottom">4</property> + <property name="label" translatable="yes">No results found</property> + <property name="yalign">0</property> + <attributes> + <attribute name="weight" value="bold"/> + <attribute name="scale" value="2"/> + </attributes> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + <property name="tab_expand">True</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Install Packages</property> + </object> + <packing> + <property name="position">1</property> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkImage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">end</property> + <property name="pixbuf">pixmaps/docs.png</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <placeholder/> + </child> + <child type="center"> + <object class="GtkLinkButton"> + <property name="label" translatable="yes">Find out how to create and upload Extensions</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="focus_on_click">False</property> + <property name="receives_default">True</property> + <property name="valign">start</property> + <property name="relief">none</property> + <property name="uri">https://inkscape.org/develop/extensions/</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">2</property> + <property name="tab_expand">True</property> + </packing> + </child> + <child type="tab"> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Create Package</property> + </object> + <packing> + <property name="position">2</property> + <property name="tab_fill">False</property> + </packing> + </child> + </object> + </child> + </object> + <object class="GtkFileChooserDialog" id="choose-extension"> + <property name="can_focus">False</property> + <property name="type">popup</property> + <property name="title" translatable="yes">Choose Extensions Package File</property> + <property name="type_hint">dialog</property> + <property name="gravity">center</property> + <property name="transient_for">gui</property> + <property name="filter">filter-for-extensions</property> + <property name="local_only">False</property> + <property name="preview_widget_active">False</property> + <property name="use_preview_label">False</property> + <child internal-child="vbox"> + <object class="GtkBox"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <placeholder/> + </child> + </object> + </child> + </object> +</interface> diff --git a/share/extensions/other/inkman/inkman/data/info.ui b/share/extensions/other/inkman/inkman/data/info.ui new file mode 100644 index 0000000..ace3436 --- /dev/null +++ b/share/extensions/other/inkman/inkman/data/info.ui @@ -0,0 +1,338 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.22.2 + +Copyright (C) Martin Owens + +This file is part of Inkscape Extensions Manager. + +Inkscape Extensions Manager 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. + +Inkscape Extensions Manager 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 Inkscape Extensions Manager. If not, see <http://www.gnu.org/licenses/>. + +--> +<interface domain="inkscape-extensions-manager"> + <requires lib="gtk+" version="3.18"/> + <!-- interface-license-type gplv3 --> + <!-- interface-name Inkscape Extensions Manager --> + <!-- interface-description Download and manage inkscape extensions --> + <!-- interface-copyright Martin Owens --> + <object class="GtkWindow" id="info"> + <property name="can_focus">False</property> + <property name="title" translatable="yes">Package Information</property> + <property name="modal">True</property> + <property name="window_position">center-always</property> + <property name="default_width">500</property> + <property name="default_height">350</property> + <property name="icon_name">gtk-about</property> + <child type="titlebar"> + <placeholder/> + </child> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkLabel" id="info_name"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_top">7</property> + <property name="margin_bottom">7</property> + <property name="hexpand">True</property> + <property name="label" translatable="yes">Package Name</property> + <property name="xalign">0</property> + <attributes> + <attribute name="weight" value="bold"/> + <attribute name="scale" value="1.5"/> + </attributes> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">2</property> + </packing> + </child> + <child> + <object class="GtkImage" id="info_image"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">5</property> + <property name="margin_right">5</property> + <property name="margin_top">5</property> + <property name="margin_bottom">5</property> + <property name="stock">gtk-about</property> + <property name="icon_size">6</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="height">3</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="info_desc"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">6</property> + <property name="margin_right">6</property> + <property name="margin_top">2</property> + <property name="margin_bottom">2</property> + <property name="label" translatable="yes">Package Description</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <attributes> + <attribute name="style" value="italic"/> + </attributes> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">2</property> + <property name="height">2</property> + </packing> + </child> + <child> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">4</property> + <property name="margin_right">8</property> + <property name="row_homogeneous">True</property> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">2</property> + <property name="margin_right">6</property> + <property name="margin_top">2</property> + <property name="margin_bottom">2</property> + <property name="label" translatable="yes">License:</property> + <property name="xalign">1</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">2</property> + <property name="margin_right">6</property> + <property name="margin_top">2</property> + <property name="margin_bottom">2</property> + <property name="label" translatable="yes">Author:</property> + <property name="xalign">1</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">2</property> + <property name="margin_right">6</property> + <property name="margin_top">2</property> + <property name="margin_bottom">2</property> + <property name="label" translatable="yes">Version:</property> + <property name="xalign">1</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">2</property> + <property name="margin_right">6</property> + <property name="margin_top">2</property> + <property name="margin_bottom">2</property> + <property name="label" translatable="yes">Website:</property> + <property name="xalign">1</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> + </packing> + </child> + <child> + <object class="GtkAccelLabel" id="info_author"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">label</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkAccelLabel" id="info_license"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">label</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkAccelLabel" id="info_version"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">label</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="GtkLinkButton" id="info_website"> + <property name="label" translatable="yes">button</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="focus_on_click">False</property> + <property name="receives_default">True</property> + <property name="hexpand">True</property> + <property name="relief">none</property> + <property name="xalign">0</property> + <property name="uri">https://inkscape.org</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">3</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> + <property name="width">3</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box_inx_padding"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkScrolledWindow"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkTreeView" id="inx"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <child internal-child="selection"> + <object class="GtkTreeSelection"/> + </child> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="padding">4</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="padding">4</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkBox" id="buttons_installed1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">8</property> + <child> + <object class="GtkButton" id="info_close"> + <property name="label">gtk-close</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_underline">True</property> + <property name="use_stock">True</property> + <property name="always_show_image">True</property> + <signal name="activate" handler="destroy" swapped="no"/> + <signal name="clicked" handler="destroy" swapped="no"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="padding">4</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="padding">4</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + </object> +</interface> diff --git a/share/extensions/other/inkman/inkman/data/package.json b/share/extensions/other/inkman/inkman/data/package.json new file mode 100644 index 0000000..e064c7e --- /dev/null +++ b/share/extensions/other/inkman/inkman/data/package.json @@ -0,0 +1,20 @@ +{ + "author" : "doctormo", + "dates" : { + "created" : "2021-04-22T15:08:20", + "edited" : "2021-04-22T15:08:20" + }, + "files" : [], + "icon" : "inkman/data/pixmaps/icon.svg", + "id" : "org.inkscape.extension.inkman", + "license" : "GPLv3", + "links" : { + "file": "https://media.inkscape.org/static/extensions-manager-fallback.zip" + }, + "name" : "Inkscape Extensions Manager", + "summary" : "Manage extensions from inside another extension", + "tags" : [ + "infrastructure" + ], + "verified" : true +} diff --git a/share/extensions/other/inkman/inkman/data/pixmaps/__init__.py b/share/extensions/other/inkman/inkman/data/pixmaps/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/share/extensions/other/inkman/inkman/data/pixmaps/__init__.py diff --git a/share/extensions/other/inkman/inkman/data/pixmaps/core_icon.svg b/share/extensions/other/inkman/inkman/data/pixmaps/core_icon.svg new file mode 100644 index 0000000..427aa3d --- /dev/null +++ b/share/extensions/other/inkman/inkman/data/pixmaps/core_icon.svg @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + inkscape:export-ydpi="131.66" + inkscape:export-xdpi="131.66" + inkscape:export-filename="/home/doctormo/Desktop/mountain.png" + sodipodi:docname="inkscape_extensions_icon.svg" + inkscape:version="1.0alpha (2b290efb96, 2019-03-26, custom)" + version="1.1" + id="svg4197" + viewBox="0 0 64 64" + height="64" + width="64"> + <style + id="style4677"></style> + <defs + id="defs4199" /> + <sodipodi:namedview + inkscape:document-rotation="0" + units="px" + borderlayer="true" + inkscape:pagecheckerboard="true" + fit-margin-bottom="0" + fit-margin-right="0" + fit-margin-left="0" + fit-margin-top="0" + inkscape:snap-global="false" + inkscape:guide-bbox="true" + inkscape:window-maximized="1" + inkscape:window-y="24" + inkscape:window-x="65" + inkscape:window-height="1056" + inkscape:window-width="1855" + showguides="false" + showgrid="false" + inkscape:current-layer="layer1" + inkscape:document-units="px" + inkscape:cy="27.110789" + inkscape:cx="34.527038" + inkscape:zoom="1" + inkscape:pageshadow="2" + inkscape:pageopacity="0.0" + borderopacity="1.0" + bordercolor="#666666" + pagecolor="#ffffff" + id="base"> + <sodipodi:guide + inkscape:locked="false" + id="guide4855" + orientation="0,1" + position="213.44347,-263.83675" /> + <sodipodi:guide + inkscape:locked="false" + id="guide4857" + orientation="0,1" + position="161.15542,-119.0723" /> + <sodipodi:guide + inkscape:locked="false" + id="guide4859" + orientation="0,1" + position="123.12774,-219.32709" /> + <sodipodi:guide + inkscape:locked="false" + id="guide4861" + orientation="0,1" + position="198.75096,-19.681776" /> + </sodipodi:namedview> + <metadata + id="metadata4202"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + transform="translate(-178.06873,-129.03359)" + id="layer1" + inkscape:groupmode="layer" + inkscape:label="Layer 1"> + <path + id="path5071" + d="M 209.5405,129.4285 C 207.34998,129.42552 205.1775,130.23263 203.57606,131.87175 L 180.73787,155.24089 180.70575,155.28174 C 178.69019,157.77778 177.82335,159.75839 178.12831,161.55689 178.43326,163.3554 179.93035,164.45862 181.56636,165.15248 184.54546,166.41593 188.47711,166.93408 191.00679,167.90934 190.53854,168.20881 189.88311,168.55956 189.07698,168.93331 188.12313,169.37555 187.1407,169.80609 186.36388,170.40947 185.97547,170.71117 185.58188,171.06598 185.40409,171.68726 185.22629,172.30853 185.49865,173.08033 185.9292,173.52079 186.69583,174.30441 187.76672,174.76695 189.06969,175.28139 190.37267,175.79583 191.89253,176.29082 193.39752,176.78089 194.90252,177.27095 196.39192,177.7572 197.59554,178.23225 198.79916,178.70731 199.73154,179.24185 199.96148,179.47649 200.07286,179.59083 200.05024,179.59563 200.049,179.58443 200.04751,179.57307 200.05699,179.60937 199.99209,179.7405 199.91316,179.89994 199.59031,180.23549 199.33715,180.52234 L 199.11836,180.23061 C 198.37134,179.23804 197.20263,178.83569 196.08289,178.75007 194.96315,178.66446 193.82247,178.87338 192.81987,179.28978 191.81728,179.70618 190.89774,180.31007 190.44372,181.33773 190.21671,181.85157 190.15642,182.49001 190.33724,183.07791 190.51806,183.6658 190.90063,184.17841 191.41519,184.62409 L 191.41668,184.62558 C 192.81687,185.83634 194.72197,185.66624 196.13251,184.89106 196.53857,184.6679 196.85949,184.32058 197.21484,184.01732 197.2126,184.11177 197.15293,184.17908 197.16375,184.27696 197.22208,184.80377 197.49413,185.3136 197.87704,185.70499 199.29802,187.15748 201.22888,187.09479 202.56954,187.41453 203.23986,187.5744 203.76326,187.78361 204.1478,188.12052 204.53235,188.45743 204.85208,188.94085 205.03321,189.9278 205.26463,191.19231 206.31437,192.07739 207.43853,192.40168 208.5627,192.72598 209.82857,192.6867 211.16394,192.46875 213.83468,192.03289 216.77863,190.83884 218.85106,189.32242 L 218.92545,189.26843 218.99109,189.20278 C 219.33189,188.85413 219.60986,188.46483 219.70438,187.95417 219.79889,187.44352 219.60927,186.88523 219.35138,186.5524 218.8356,185.88673 218.24632,185.70061 217.7702,185.47008 217.48913,185.33399 217.44505,185.29804 217.30489,185.21043 219.52047,183.01064 221.49737,182.63752 223.47354,182.17788 224.48172,181.9434 225.5102,181.69612 226.46379,181.07076 227.41739,180.44541 228.20663,179.42814 228.6897,177.98133 228.88529,177.39536 228.8047,176.73308 228.5628,176.24116 228.32089,175.74922 227.9685,175.38884 227.58987,175.07277 226.83261,174.44062 225.91377,173.96692 225.07807,173.51493 224.34155,173.11658 223.77119,172.75489 223.43708,172.48803 224.7278,171.82142 226.649,171.11902 228.93767,170.37152 231.45028,169.55089 234.20492,168.66561 236.55186,167.54902 238.8988,166.43242 240.93825,165.10887 241.75489,163.04615 242.16321,162.0148 242.18237,160.81543 241.7578,159.63289 241.33431,158.45334 240.5111,157.27502 239.26496,156.02709 L 239.25764,156.01835 215.62011,131.85862 215.60698,131.84548 C 213.93873,130.24384 211.73095,129.43155 209.54042,129.42849 Z M 234.714,173.71915 C 232.5042,173.79523 230.15738,174.9607 229.48763,177.32058 L 229.44533,177.47082 V 177.6269 C 229.44533,178.04315 229.64611,178.3869 229.83333,178.59252 230.02056,178.79815 230.20857,178.91889 230.39638,179.02137 230.77199,179.22632 231.1717,179.35388 231.62748,179.46772 232.53904,179.69538 233.65791,179.83206 234.79714,179.86447 235.93637,179.89689 237.07554,179.83102 238.05724,179.56253 238.54809,179.42829 239.0106,179.25051 239.42838,178.91635 239.84616,178.58218 240.21459,177.98998 240.21459,177.35267 V 177.1645 L 240.15333,176.98654 C 239.34785,174.6556 236.9238,173.64305 234.714,173.71915 Z M 229.16819,178.79382 228.74809,179.17015 C 227.9503,179.88577 227.45985,180.71346 227.36966,181.58423 227.27948,182.455 227.63563,183.29405 228.20839,183.84806 229.3539,184.95607 231.26015,185.14361 232.92277,184.16605 L 233.04967,184.09166 233.15324,183.98519 C 233.59318,183.53871 233.70115,182.97178 233.66668,182.46234 233.63222,181.95292 233.45188,181.45508 233.14302,180.98619 232.52532,180.04838 231.379,179.24613 229.72102,178.9076 Z" + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.8125;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;stop-opacity:1" + inkscape:connector-curvature="0" /> + <path + d="M 204.3716,132.65025 181.5716,155.98146 C 173.86808,165.52135 186.81421,164.41139 192.36401,167.15913 194.35481,169.19406 184.73346,170.69607 186.72426,172.73269 188.71506,174.76762 198.7624,176.65319 200.75659,178.68812 202.74739,180.72304 196.68165,182.88186 198.67245,184.91679 200.66325,186.95171 205.26771,185.02371 206.12988,189.72152 206.74427,193.07856 214.42743,191.16413 218.185,188.41469 220.1758,186.37807 214.37651,186.56985 216.36731,184.53492 221.318,179.47222 225.92756,182.69517 227.62135,177.62228 228.45806,175.11554 220.33363,173.75779 222.32783,171.72286 228.05583,168.37771 247.8535,166.20022 238.45958,156.8063 L 214.82627,132.65025 C 211.93596,129.87535 207.11255,129.8448 204.3716,132.65025 Z M 230.56088,177.62228 C 230.56088,178.77976 239.08924,179.53841 239.08924,177.34904 237.87405,173.83247 231.56901,174.07007 230.56088,177.62228 Z M 192.14337,183.77289 C 194.16303,185.51929 197.28245,183.33841 198.2176,180.90125 196.26075,178.30116 188.93569,180.99459 192.14337,183.77289 Z M 229.49165,180.00004 C 226.88817,182.33537 229.78357,184.70464 232.34971,183.19584 232.92166,182.6154 232.33444,180.58048 229.49165,180.00004 Z" + id="path2313" + inkscape:connector-curvature="0" + style="opacity:1;fill:#292929;fill-opacity:1;stroke-width:0.436606;stop-opacity:1" /> + <path + d="M 198.91515,168.42184 C 199.52444,168.80031 208.74016,170.67231 210.99232,171.04569 211.77303,171.21031 211.21975,172.01478 210.14373,172.55788 207.71675,173.20281 195.94507,168.42184 198.91515,168.42184 Z" + id="path2315" + style="opacity:1;fill:#ffffff;stroke-width:0.436606;stop-opacity:1" + inkscape:connector-curvature="0" /> + <path + transform="translate(178.06873,129.03359)" + d="M 31.679688 3.7441406 C 30.537215 3.7380972 29.393387 4.090031 28.464844 4.8027344 C 28.39423 4.8361426 28.29204 4.8663172 28.25 4.9023438 L 26.128906 7.0703125 C 24.095858 9.0926283 21.577521 11.575345 19.125 14.222656 C 19.118823 14.228833 19.115505 14.235994 19.109375 14.242188 L 16.302734 17.109375 C 15.581634 17.727295 15.567684 18.734057 16.271484 19.367188 L 19.919922 24.447266 C 20.070432 23.674156 20.494753 22.962973 21.132812 22.414062 C 22.810133 20.976713 25.495743 21.005826 27.132812 22.478516 C 28.769883 23.951206 28.737867 26.308734 27.060547 27.746094 C 26.420257 28.292904 25.600597 28.650132 24.716797 28.763672 L 30.363281 33.841797 C 31.067031 34.474897 32.214467 34.487051 32.935547 33.869141 L 38.712891 28.919922 C 38.845461 29.689672 39.248787 30.403017 39.867188 30.960938 C 41.504257 32.433637 44.191811 32.462751 45.869141 31.025391 C 47.546461 29.588041 47.578476 27.228559 45.941406 25.755859 C 45.320616 25.199729 44.516148 24.827829 43.642578 24.693359 L 47.421875 19.742188 C 48.142965 19.124277 48.156895 18.115532 47.453125 17.482422 L 34.859375 4.6699219 C 34.765175 4.5851804 34.580964 4.5192514 34.347656 4.4648438 C 33.539452 3.9959559 32.612718 3.7490762 31.679688 3.7441406 z " + style="opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.66165;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stop-opacity:1" + id="rect4513" /> + </g> +</svg> diff --git a/share/extensions/other/inkman/inkman/data/pixmaps/default.svg b/share/extensions/other/inkman/inkman/data/pixmaps/default.svg new file mode 100644 index 0000000..4595b57 --- /dev/null +++ b/share/extensions/other/inkman/inkman/data/pixmaps/default.svg @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + sodipodi:docname="default.svg" + inkscape:version="1.0alpha (2b290efb96, 2019-03-26, custom)" + id="svg8" + version="1.1" + viewBox="0 0 16.93333316 16.93333345" + height="64" + width="64"> + <defs + id="defs2" /> + <sodipodi:namedview + inkscape:document-rotation="0" + inkscape:window-maximized="1" + inkscape:window-y="41" + inkscape:window-x="140" + inkscape:window-height="1685" + inkscape:window-width="3060" + units="px" + showgrid="false" + inkscape:current-layer="layer1" + inkscape:document-units="mm" + inkscape:cy="33.563305" + inkscape:cx="31.124255" + inkscape:zoom="6.466344" + inkscape:pageshadow="2" + inkscape:pageopacity="0.0" + borderopacity="1.0" + bordercolor="#666666" + pagecolor="#ffffff" + id="base" /> + <metadata + id="metadata5"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + transform="translate(-104.6139974,-111.3056386)" + id="layer1" + inkscape:groupmode="layer" + inkscape:label="Layer 1"> + <rect + y="112.3309021" + x="105.7384796" + height="14.96549511" + width="14.84974003" + id="rect835" + style="fill:none;fill-rule:evenodd;stroke:#d3d7cf;stroke-width:0.2645833176;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:1.5874999054,1.5874999054;stroke-dashoffset:0" /> + <g + transform="translate(-0.49307671,2.7778151)" + style="font-size:10.5833px;line-height:1.25;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;stroke-width:0.264583;fill:#204a87" + id="text11" + aria-label="X"> + <path + inkscape:connector-curvature="0" + id="path13" + style="stroke-width:0.264583;fill:#204a87" + d="M 110.82334,113.5657 H 111.94472 L 113.86191,116.43373 115.78943,113.5657 H 116.91081 L 114.43035,117.27089 117.07617,121.28097 H 115.9548 L 113.78439,117.99952 111.59849,121.28097 H 110.47194 L 113.22629,117.16237 Z" /> + </g> + </g> +</svg> diff --git a/share/extensions/other/inkman/inkman/data/pixmaps/default_icon.svg b/share/extensions/other/inkman/inkman/data/pixmaps/default_icon.svg new file mode 100644 index 0000000..a760f78 --- /dev/null +++ b/share/extensions/other/inkman/inkman/data/pixmaps/default_icon.svg @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="64" + height="64" + viewBox="0 0 16.93333316 16.93333345" + version="1.1" + id="svg8" + inkscape:version="0.92.3 (unknown)" + sodipodi:docname="default.svg"> + <defs + id="defs2" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="15.99999997" + inkscape:cx="29.02735304" + inkscape:cy="33.63202807" + inkscape:document-units="mm" + inkscape:current-layer="layer1" + showgrid="false" + units="px" + inkscape:window-width="3060" + inkscape:window-height="1685" + inkscape:window-x="140" + inkscape:window-y="41" + inkscape:window-maximized="1" /> + <metadata + id="metadata5"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-104.6139974,-111.3056386)"> + <path + style="fill:#eeeeec;fill-rule:evenodd;stroke:#babdb6;stroke-width:0.2386619151;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 108.2894698,113.4403262 c -0.7182845,0.506619 -0.8898933,1.4995894 -0.3833046,2.2178952 0.2866841,0.405192 0.7459924,0.6534367 1.2420265,0.6712842 0.4163061,0.010708 0.7906509,0.2198627 0.5335476,0.9022922 l -2.7910571,1.9683322 5.1978275,7.3704189 7.3704189,-5.1978275 -1.6793944,-2.3813488 c -0.6258858,-0.3783537 -0.8100563,0.06791 -0.8959132,0.4218985 -0.04696,0.4568329 -0.2889598,0.8711156 -0.6638235,1.1364054 -0.7183453,0.5066164 -1.7113753,0.3349578 -2.2179663,-0.3834054 -0.5065329,-0.7183452 -0.3348473,-1.7113024 0.3834765,-2.2178656 0.4060691,-0.2854401 0.9220589,-0.3650913 1.3952995,-0.2153867 0.3640113,0.203938 0.9966101,-0.036635 0.6685328,-0.6281194 l -2.1880389,-3.1025969 -2.7646504,1.9497095 c -1.0190194,0.075719 -0.8191806,-0.502389 -0.7451992,-0.8349773 0.1091227,-0.446087 0.020238,-0.9175675 -0.2438155,-1.293303 -0.5065909,-0.7183632 -1.4996209,-0.8900218 -2.2179662,-0.3834055 z" + id="rect815" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccccccccccccccccc" /> + <rect + style="fill:none;fill-rule:evenodd;stroke:#d3d7cf;stroke-width:0.2645833176;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:1.5874999054,1.5874999054;stroke-dashoffset:0" + id="rect835" + width="14.84974003" + height="14.96549511" + x="105.7384796" + y="112.3309021" /> + </g> +</svg> diff --git a/share/extensions/other/inkman/inkman/data/pixmaps/docs.png b/share/extensions/other/inkman/inkman/data/pixmaps/docs.png Binary files differnew file mode 100644 index 0000000..4613579 --- /dev/null +++ b/share/extensions/other/inkman/inkman/data/pixmaps/docs.png diff --git a/share/extensions/other/inkman/inkman/data/pixmaps/icon.svg b/share/extensions/other/inkman/inkman/data/pixmaps/icon.svg new file mode 100644 index 0000000..88531a5 --- /dev/null +++ b/share/extensions/other/inkman/inkman/data/pixmaps/icon.svg @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + id="svg4197" + viewBox="0 0 64 64" + height="64" + width="64" + sodipodi:docname="icon.svg" + inkscape:version="1.0alpha (2b290efb96, 2019-03-26, custom)" + inkscape:export-filename="/home/doctormo/Projects/inkscape/extension-manager-icon.png" + inkscape:export-xdpi="450" + inkscape:export-ydpi="450"> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + inkscape:document-rotation="0" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="640" + inkscape:window-height="480" + id="namedview11" + showgrid="false" + inkscape:zoom="7.5328968" + inkscape:cx="36.791894" + inkscape:cy="23.577671" + inkscape:current-layer="svg4197" /> + <style + id="style4677"></style> + <defs + id="defs4199" /> + <metadata + id="metadata4202"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <circle + r="32" + cy="32" + cx="32" + id="path834" + style="vector-effect:none;fill:#ffffff;stroke-width:3.26454;paint-order:stroke fill markers;stop-color:#000000" /> + <path + d="M 7.6191406 52.724609 A 32 32 0 0 0 7.703125 52.826172 A 32 32 0 0 0 8.015625 53.183594 A 32 32 0 0 0 8.3339844 53.539062 A 32 32 0 0 0 8.65625 53.886719 A 32 32 0 0 0 8.984375 54.232422 A 32 32 0 0 0 9.3164062 54.572266 A 32 32 0 0 0 9.6542969 54.90625 A 32 32 0 0 0 9.9863281 55.226562 C 16.105243 54.967467 24.037299 58.544938 32.347656 58.544922 C 40.350548 58.544828 47.993984 55.240607 54.015625 55.222656 A 32 32 0 0 0 54.232422 55.015625 A 32 32 0 0 0 54.572266 54.683594 A 32 32 0 0 0 54.90625 54.345703 A 32 32 0 0 0 55.236328 54.001953 A 32 32 0 0 0 55.560547 53.654297 A 32 32 0 0 0 55.880859 53.300781 A 32 32 0 0 0 56.193359 52.943359 A 32 32 0 0 0 56.501953 52.582031 A 32 32 0 0 0 56.791016 52.232422 C 53.316864 45.16434 43.634403 38.271377 32.347656 38.271484 L 32.296875 38.271484 C 20.765791 38.285588 10.866821 45.496644 7.6191406 52.724609 z " + style="vector-effect:none;fill:#292929;fill-opacity:1;stroke-width:2.21703;paint-order:stroke fill markers;stop-color:#000000" + id="path839" /> + <path + inkscape:connector-curvature="0" + id="rect4513" + style="opacity:1;vector-effect:none;fill:#292929;fill-opacity:1;stroke:none;stroke-width:1.99127;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stop-opacity:1" + d="M 19.303148,12.112056 18.542504,27.990548 C 18.541959,28.001003 18.544746,28.01004 18.544258,28.020473 L 18.344944,32.824472 C 18.1985,33.953027 18.993569,34.860619 20.128032,34.859853 L 27.451088,36.456782 C 26.965015,35.647699 26.772409,34.674141 26.900262,33.673637 27.240872,31.048526 29.655443,28.920414 32.294253,28.918636 34.933064,28.916856 36.795449,31.041636 36.454848,33.666756 36.323322,34.667181 35.880031,35.642669 35.184178,36.452628 L 44.284693,36.445255 C 45.419087,36.444503 46.450493,35.535007 46.596926,34.406478 L 47.771375,25.365976 C 48.506804,25.945018 49.438066,26.256673 50.436167,26.257439 53.074986,26.255669 55.491287,24.125999 55.831898,21.500871 56.172505,18.875762 54.308553,16.749243 51.669734,16.751013 50.670942,16.753758 49.656369,17.06786 48.770704,17.64879 L 48.164563,10.209114 C 48.311005,9.080576 47.514329,8.171235 46.379909,8.171995 L 24.270089,7.092808 C 21.243419,6.945075 19.456256,8.915898 19.303148,12.112056 Z" + sodipodi:nodetypes="sccccccsccccccsccccss" /> + <path + inkscape:connector-curvature="0" + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke-width:0.413415;stop-opacity:1" + id="path2315" + d="M 33.926341,14.807412 C 34.596959,14.914846 43.329875,13.175638 45.433255,12.677163 46.175275,12.535096 45.986647,13.440152 45.24585,14.308346 43.362617,15.760055 31.332738,15.894772 33.926341,14.807412 Z" /> + <path + id="path847" + style="vector-effect:none;fill:#ffffff;fill-opacity:1;stroke-width:2.09548;paint-order:stroke fill markers;stop-color:#000000" + d="M 39.369141 17.474609 A 3.4422221 3.4422221 0 0 0 35.927734 20.917969 A 3.4422221 3.4422221 0 0 0 39.369141 24.359375 A 3.4422221 3.4422221 0 0 0 42.035156 23.095703 A 2.2169242 2.2169242 0 0 1 41.234375 23.246094 A 2.2169242 2.2169242 0 0 1 39.017578 21.029297 A 2.2169242 2.2169242 0 0 1 41.234375 18.8125 A 2.2169242 2.2169242 0 0 1 42.273438 19.070312 A 3.4422221 3.4422221 0 0 0 39.369141 17.474609 z " /> +</svg> diff --git a/share/extensions/other/inkman/inkman/data/pixmaps/module_icon.svg b/share/extensions/other/inkman/inkman/data/pixmaps/module_icon.svg new file mode 100644 index 0000000..ec65871 --- /dev/null +++ b/share/extensions/other/inkman/inkman/data/pixmaps/module_icon.svg @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + inkscape:export-ydpi="450" + inkscape:export-xdpi="450" + inkscape:export-filename="/home/doctormo/Projects/inkscape/extension-manager-icon.png" + inkscape:version="1.0alpha (2b290efb96, 2019-03-26, custom)" + sodipodi:docname="module_icon.svg" + width="64" + height="64" + viewBox="0 0 64 64" + id="svg4197" + version="1.1"> + <sodipodi:namedview + inkscape:current-layer="svg4197" + inkscape:cy="38.727324" + inkscape:cx="54.205688" + inkscape:zoom="2.5592283" + showgrid="false" + id="namedview11" + inkscape:window-height="480" + inkscape:window-width="640" + inkscape:pageshadow="2" + inkscape:pageopacity="0" + guidetolerance="10" + gridtolerance="10" + objecttolerance="10" + borderopacity="1" + inkscape:document-rotation="0" + bordercolor="#666666" + pagecolor="#ffffff" /> + <style + id="style4677" /> + <defs + id="defs4199" /> + <metadata + id="metadata4202"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <circle + style="vector-effect:none;fill:#ffffff;stroke-width:3.26454;paint-order:stroke fill markers;stop-color:#000000" + id="path834" + cx="32" + cy="32" + r="32" /> + <g + style="stroke-width:0.869886" + transform="matrix(1.1495756,0,0,1.1495756,-3.0475334,-5.4195001)" + id="g242"> + <rect + style="vector-effect:none;fill:#eeeeec;stroke-width:2.63021;paint-order:stroke fill markers;stop-color:#000000" + id="rect237" + width="31.052795" + height="32.093048" + x="15.564622" + y="16.079668" /> + <path + inkscape:connector-curvature="0" + id="path2995" + d="M 14.625549,42.099718 C 13.503629,41.895725 12.39879,41.21575 11.618065,40.248754 10.139271,38.417143 9.392752,35.363536 9.486467,31.529552 9.544868,29.14036 9.902051,27.366796 10.628668,25.858038 11.565272,23.913262 12.964687,22.75995 14.853848,22.375902 15.267645,22.291781 15.288387,22.291563 22.576421,22.294473 26.595635,22.296073 29.913564,22.286078 29.949594,22.272252 30.006771,22.25031 30.015105,22.161407 30.015105,21.573288 30.015105,21.202686 30.010613,20.895154 30.005139,20.889884 29.999649,20.884615 27.769431,20.871152 25.049086,20.859967 L 20.103004,20.839633 20.09273,18.268997 C 20.081487,15.453473 20.079227,15.486121 20.320279,14.969047 21.15591,13.176522 23.617496,12.087429 27.562008,11.765052 27.847204,11.741745 28.619033,11.71212 29.27718,11.699221 33.644211,11.613636 36.847655,12.412177 38.531531,14.006105 38.718075,14.182684 38.961181,14.446253 39.071768,14.591813 39.323225,14.922794 39.636229,15.5547 39.756079,15.973327 L 39.847435,16.292429 V 21.5975 C 39.847435,26.549469 39.842636,26.927793 39.775284,27.281505 39.688376,27.737937 39.479626,28.379249 39.305646,28.724304 38.703301,29.918941 37.593484,30.7796 36.122299,31.192977 35.167006,31.461397 35.600881,31.443762 29.27718,31.4712 22.997208,31.498447 23.376661,31.483823 22.496263,31.732635 20.786238,32.215922 19.529987,33.547819 19.019642,35.418608 18.790219,36.259608 18.795311,36.181036 18.770188,39.267775 L 18.746814,42.139694 16.832202,42.146255 C 15.386863,42.151216 14.846009,42.139811 14.625549,42.099717 Z M 25.080494,18.237304 C 25.806386,17.896282 26.243527,17.096908 26.112111,16.350848 25.990888,15.662656 25.518343,15.113424 24.877046,14.915347 23.852127,14.598782 22.782711,15.252026 22.593611,16.310165 22.439817,17.170741 22.937534,18.008531 23.77931,18.306007 23.967428,18.372489 24.088398,18.385964 24.410875,18.376368 24.762209,18.365918 24.842023,18.349337 25.080494,18.237304 Z" + style="opacity:1;fill:#888a85;stroke-width:0.869885;stop-opacity:1" /> + <path + inkscape:connector-curvature="0" + id="path2997" + style="opacity:1;fill:#d3d7cf;stroke-width:0.869885;stop-opacity:1" + d="M 42.380859,22.976562 42.357422,25.828125 C 42.332264,28.89593 42.34023,28.802437 42.107422,29.675781 41.79745,30.838593 41.102041,31.920288 40.261719,32.552734 39.558289,33.08215 38.810132,33.377284 37.667969,33.574219 37.473024,33.607832 35.778076,33.628381 31.691406,33.646484 L 25.988281,33.671875 25.529297,33.775391 C 23.454805,34.246931 22.127347,35.329879 21.566406,37.007812 21.258997,37.927379 21.254942,38.043388 21.269531,43.818359 L 21.28125,48.863281 21.373047,49.164062 C 22.155194,51.73786 25.228562,53.210137 30.195312,53.390625 31.156468,53.425551 32.429989,53.407933 33.328125,53.347656 35.997484,53.1685 38.021231,52.631561 39.349609,51.75 39.78695,51.459765 40.432318,50.812464 40.644531,50.451172 40.850602,50.100336 40.994463,49.698872 41.035156,49.359375 41.051976,49.219016 41.055886,48.008156 41.044922,46.669922 L 41.025391,44.236328 36.080078,44.216797 31.132812,44.197266 V 43.519531 42.841797 L 38.591797,42.820312 C 46.870993,42.796644 46.166286,42.820836 47.007812,42.535156 48.480937,42.035062 49.647445,40.959439 50.4375,39.371094 50.829249,38.583507 51.090743,37.819199 51.291016,36.878906 51.494779,35.922238 51.496534,35.894972 51.496094,32.978516 51.495632,29.981723 51.492366,29.938408 51.238281,28.763672 50.57768,25.709456 49.025839,23.68471 46.888672,23.087891 L 46.490234,22.976562 H 44.435547 Z M 36.613281,46.707031 C 36.753866,46.69394 36.89875,46.698435 37.044922,46.722656 37.810922,46.849586 38.405501,47.446414 38.535156,48.216797 38.692341,49.150769 38.010003,50.083722 37.056641,50.238281 36.914043,50.261393 36.771188,50.277784 36.738281,50.275391 35.851362,50.210736 35.170897,49.614574 35.019531,48.767578 34.837451,47.748719 35.629189,46.798672 36.613281,46.707031 Z" /> + </g> +</svg> diff --git a/share/extensions/other/inkman/inkman/data/pixmaps/not-found.png b/share/extensions/other/inkman/inkman/data/pixmaps/not-found.png Binary files differnew file mode 100644 index 0000000..40d6dec --- /dev/null +++ b/share/extensions/other/inkman/inkman/data/pixmaps/not-found.png diff --git a/share/extensions/other/inkman/inkman/data/pixmaps/orphan_icon.svg b/share/extensions/other/inkman/inkman/data/pixmaps/orphan_icon.svg new file mode 100644 index 0000000..ed05621 --- /dev/null +++ b/share/extensions/other/inkman/inkman/data/pixmaps/orphan_icon.svg @@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + width="64" + height="64" + viewBox="0 0 16.93333316 16.93333345" + version="1.1" + id="svg8" + inkscape:version="1.1-dev (b07433122b, 2020-08-20, custom)" + sodipodi:docname="orphan_icon.svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + <defs + id="defs2" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="5.5291091" + inkscape:cx="28.576032" + inkscape:cy="40.965008" + inkscape:document-units="mm" + inkscape:current-layer="layer1" + showgrid="false" + units="px" + inkscape:window-width="1534" + inkscape:window-height="843" + inkscape:window-x="66" + inkscape:window-y="20" + inkscape:window-maximized="1" + inkscape:snap-global="false" /> + <metadata + id="metadata5"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-104.6139974,-111.3056386)"> + <g + aria-label="?" + id="text853" + style="font-size:7.55014px;line-height:1.25;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;stroke-width:0.56626"> + <path + d="m 111.37404,118.63979 c 0.2567,-0.302 0.65686,-0.61911 0.98152,-0.61911 0.26425,0 0.55871,0.0679 0.55871,0.35486 0,0.41526 -1.20048,0.80786 -1.20048,1.50248 v 0.60401 h 1.40433 v -0.41526 c 0,-0.45301 1.20047,-0.69461 1.20047,-1.67613 0,-1.01927 -0.79276,-1.54778 -1.79693,-1.54778 -0.75501,0 -1.43453,0.36241 -1.96304,0.97397 z m 0.14345,2.83131 c 0,0.3926 0.36996,0.77766 0.86072,0.77766 0.55116,0 0.89846,-0.35486 0.89846,-0.77766 0,-0.43036 -0.3624,-0.80032 -0.89846,-0.80032 -0.54361,0 -0.86072,0.42281 -0.86072,0.80032 z" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:ChunkFive;-inkscape-font-specification:ChunkFive;stroke-width:0.56626" + id="path855" /> + </g> + <rect + style="fill:none;fill-rule:evenodd;stroke:#d3d7cf;stroke-width:0.2645833176;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:1.5874999054,1.5874999054;stroke-dashoffset:0" + id="rect835" + width="14.84974003" + height="14.96549511" + x="105.7384796" + y="112.3309021" /> + <g + transform="matrix(0.68391582,0,0,0.68391582,-90.169298,-291.32001)" + inkscape:label="00125" + id="zoom"> + <path + inkscape:connector-curvature="0" + id="rect14085" + d="m 285,589.36218 h 24 v 24 h -24 z" + style="opacity:0;fill:none" /> + <path + id="path14089" + d="m 296.4611,591.3622 c -5.2682,0 -9.5389,4.1724 -9.5389,9.299 0,5.1268 4.2707,9.26 9.5389,9.26 1.8739,0 3.6132,-0.5373 5.0874,-1.4455 L 305,612.3622 c 0.6588,0.6397 1.6958,0.6101 2.345,-0.039 l 0.3179,-0.3126 c 0.6492,-0.6492 0.6588,-1.7046 0,-2.3442 l -3.372,-3.7695 c 1.0675,-1.499 1.7091,-3.2737 1.7091,-5.2357 0,-5.1267 -4.2707,-9.2989 -9.5389,-9.2989 z m 0,2.5006 c 3.8633,0 6.9952,3.0787 6.9952,6.8766 0,3.7978 -3.1319,6.8766 -6.9952,6.8766 -3.8633,0 -6.9952,-3.0788 -6.9952,-6.8766 0,-3.7979 3.1319,-6.8766 6.9952,-6.8766 z" + style="opacity:1" + inkscape:connector-curvature="0" /> + </g> + </g> +</svg> diff --git a/share/extensions/other/inkman/inkman/data/pixmaps/star-lots.svg b/share/extensions/other/inkman/inkman/data/pixmaps/star-lots.svg new file mode 100644 index 0000000..a73f3a9 --- /dev/null +++ b/share/extensions/other/inkman/inkman/data/pixmaps/star-lots.svg @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + id="svg1" + width="16" + height="16" + version="1.1" + sodipodi:docname="star-lots.svg" + viewBox="0 0 16 16" + inkscape:version="1.1-dev (7d577b7e42, 2020-12-31)" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + <metadata + id="metadata20"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1534" + inkscape:window-height="843" + id="namedview18" + showgrid="false" + inkscape:pagecheckerboard="0" + inkscape:zoom="11.582833" + inkscape:cx="-3.8418924" + inkscape:cy="13.856713" + inkscape:window-x="66" + inkscape:window-y="20" + inkscape:window-maximized="1" + inkscape:current-layer="svg1" /> + <defs + id="defs3" /> + <g + id="star_angled" + style="display:inline;opacity:1" + transform="translate(-1296,-562)"> + <rect + height="16" + id="rect11798" + style="display:inline;opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:1.5;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + width="16" + x="1296" + y="562" /> + <path + d="m 109.11231,194.24583 -3.48759,2.20705 -0.0186,4.12722 -3.17675,-2.63488 -3.930991,1.25764 1.524251,-3.83549 -2.410831,-3.34996 4.118791,0.26442 2.44101,-3.32803 1.0213,3.99891 z" + id="path8412" + inkscape:flatsided="false" + inkscape:randomized="0" + inkscape:rounded="0" + sodipodi:arg1="-0.122765" + sodipodi:arg2="0.5055535" + sodipodi:cx="103" + sodipodi:cy="195" + sodipodi:r1="6.158659" + sodipodi:r2="3" + sodipodi:sides="5" + sodipodi:type="star" + style="display:inline;overflow:visible;visibility:visible;fill:#babdb6;fill-opacity:1;fill-rule:evenodd;stroke:#555753;stroke-width:0.78099883;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;enable-background:accumulate" + transform="matrix(1.281336,-0.0360118,0.0342919,1.278526,1164.898,324.7687)" /> + <path + d="m 108.97917,194.25051 -3.43374,2.00094 0.015,4.20347 -2.96409,-2.64736 -3.99309,1.31326 1.60183,-3.6371 -2.482907,-3.39184 3.954077,0.39951 2.45857,-3.40952 0.84192,3.884 z" + id="path8414" + inkscape:flatsided="false" + inkscape:randomized="0" + inkscape:rounded="3.469447e-18" + sodipodi:arg1="-0.1246996" + sodipodi:arg2="0.4569409" + sodipodi:cx="103" + sodipodi:cy="195" + sodipodi:r1="6.025959" + sodipodi:r2="2.8364279" + sodipodi:sides="5" + sodipodi:type="star" + style="display:inline;overflow:visible;visibility:visible;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#c4a000;stroke-width:1.02712524;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;enable-background:accumulate" + transform="matrix(0.9659898,-0.0226454,0.0246692,0.9806753,1199.236,381.5034)" /> + </g> +</svg> diff --git a/share/extensions/other/inkman/inkman/data/pixmaps/star-none.svg b/share/extensions/other/inkman/inkman/data/pixmaps/star-none.svg new file mode 100644 index 0000000..1b30ff0 --- /dev/null +++ b/share/extensions/other/inkman/inkman/data/pixmaps/star-none.svg @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + id="svg1" + width="16" + height="16" + version="1.1" + sodipodi:docname="star-none.svg" + viewBox="0 0 16 16" + inkscape:version="1.1-dev (7d577b7e42, 2020-12-31)" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + <metadata + id="metadata20"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1534" + inkscape:window-height="843" + id="namedview18" + showgrid="false" + inkscape:pagecheckerboard="0" + inkscape:zoom="11.582833" + inkscape:cx="-3.8418924" + inkscape:cy="13.856713" + inkscape:window-x="66" + inkscape:window-y="20" + inkscape:window-maximized="1" + inkscape:current-layer="svg1" /> + <defs + id="defs3" /> + <g + id="star_angled" + style="display:inline;opacity:0.2" + transform="translate(-1296,-562)"> + <rect + height="16" + id="rect11798" + style="display:inline;opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:1.5;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + width="16" + x="1296" + y="562" /> + <path + d="m 109.11231,194.24583 -3.48759,2.20705 -0.0186,4.12722 -3.17675,-2.63488 -3.930991,1.25764 1.524251,-3.83549 -2.410831,-3.34996 4.118791,0.26442 2.44101,-3.32803 1.0213,3.99891 z" + id="path8412" + inkscape:flatsided="false" + inkscape:randomized="0" + inkscape:rounded="0" + sodipodi:arg1="-0.122765" + sodipodi:arg2="0.5055535" + sodipodi:cx="103" + sodipodi:cy="195" + sodipodi:r1="6.158659" + sodipodi:r2="3" + sodipodi:sides="5" + sodipodi:type="star" + style="display:inline;overflow:visible;visibility:visible;fill:#babdb6;fill-opacity:1;fill-rule:evenodd;stroke:#555753;stroke-width:0.78099883;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;enable-background:accumulate" + transform="matrix(1.281336,-0.0360118,0.0342919,1.278526,1164.898,324.7687)" /> + <path + d="m 108.97917,194.25051 -3.43374,2.00094 0.015,4.20347 -2.96409,-2.64736 -3.99309,1.31326 1.60183,-3.6371 -2.482907,-3.39184 3.954077,0.39951 2.45857,-3.40952 0.84192,3.884 z" + id="path8414" + inkscape:flatsided="false" + inkscape:randomized="0" + inkscape:rounded="3.469447e-18" + sodipodi:arg1="-0.1246996" + sodipodi:arg2="0.4569409" + sodipodi:cx="103" + sodipodi:cy="195" + sodipodi:r1="6.025959" + sodipodi:r2="2.8364279" + sodipodi:sides="5" + sodipodi:type="star" + style="display:inline;overflow:visible;visibility:visible;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#eeeeec;stroke-width:1.02712524;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;enable-background:accumulate" + transform="matrix(0.9659898,-0.0226454,0.0246692,0.9806753,1199.236,381.5034)" /> + </g> +</svg> diff --git a/share/extensions/other/inkman/inkman/data/pixmaps/star-some.svg b/share/extensions/other/inkman/inkman/data/pixmaps/star-some.svg new file mode 100644 index 0000000..da99cd7 --- /dev/null +++ b/share/extensions/other/inkman/inkman/data/pixmaps/star-some.svg @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + id="svg1" + width="16" + height="16" + version="1.1" + sodipodi:docname="star-some.svg" + viewBox="0 0 16 16" + inkscape:version="1.1-dev (7d577b7e42, 2020-12-31)" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + <metadata + id="metadata20"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1534" + inkscape:window-height="843" + id="namedview18" + showgrid="false" + inkscape:pagecheckerboard="0" + inkscape:zoom="11.582833" + inkscape:cx="-3.8418924" + inkscape:cy="13.856713" + inkscape:window-x="66" + inkscape:window-y="20" + inkscape:window-maximized="1" + inkscape:current-layer="svg1" /> + <defs + id="defs3" /> + <g + id="star_angled" + style="display:inline;opacity:1" + transform="translate(-1296,-562)"> + <rect + height="16" + id="rect11798" + style="display:inline;opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:1.5;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + width="16" + x="1296" + y="562" /> + <path + d="m 109.11231,194.24583 -3.48759,2.20705 -0.0186,4.12722 -3.17675,-2.63488 -3.930991,1.25764 1.524251,-3.83549 -2.410831,-3.34996 4.118791,0.26442 2.44101,-3.32803 1.0213,3.99891 z" + id="path8412" + inkscape:flatsided="false" + inkscape:randomized="0" + inkscape:rounded="0" + sodipodi:arg1="-0.122765" + sodipodi:arg2="0.5055535" + sodipodi:cx="103" + sodipodi:cy="195" + sodipodi:r1="6.158659" + sodipodi:r2="3" + sodipodi:sides="5" + sodipodi:type="star" + style="display:inline;overflow:visible;visibility:visible;fill:#babdb6;fill-opacity:1;fill-rule:evenodd;stroke:#555753;stroke-width:0.78099883;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;enable-background:accumulate" + transform="matrix(1.281336,-0.0360118,0.0342919,1.278526,1164.898,324.7687)" /> + <path + d="m 108.97917,194.25051 -3.43374,2.00094 0.015,4.20347 -2.96409,-2.64736 -3.99309,1.31326 1.60183,-3.6371 -2.482907,-3.39184 3.954077,0.39951 2.45857,-3.40952 0.84192,3.884 z" + id="path8414" + inkscape:flatsided="false" + inkscape:randomized="0" + inkscape:rounded="3.469447e-18" + sodipodi:arg1="-0.1246996" + sodipodi:arg2="0.4569409" + sodipodi:cx="103" + sodipodi:cy="195" + sodipodi:r1="6.025959" + sodipodi:r2="2.8364279" + sodipodi:sides="5" + sodipodi:type="star" + style="display:inline;overflow:visible;visibility:visible;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#eeeeec;stroke-width:1.02712524;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;enable-background:accumulate" + transform="matrix(0.9659898,-0.0226454,0.0246692,0.9806753,1199.236,381.5034)" /> + </g> +</svg> diff --git a/share/extensions/other/inkman/inkman/factory.py b/share/extensions/other/inkman/inkman/factory.py new file mode 100644 index 0000000..51aa77a --- /dev/null +++ b/share/extensions/other/inkman/inkman/factory.py @@ -0,0 +1,199 @@ +# +# Copyright 2020 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/> +# +""" +Extract information from an inx file and follow all the files. +""" + +import os +import sys + +from datetime import datetime +from modulefinder import ModuleFinder +from collections import defaultdict + +from inkex.inx import InxFile + +from inkman import __pkgname__, __version__ +from inkman.utils import DATA_DIR + +MODULES = ( + ( + "Depricated", + "Using depricated modules {names}", + "Critical", + ( + "bezmisc", + "cubicsuperpath", + "simplestyle", + "cspsubdiv", + "ffgeom", + "simplepath", + "simpletransform", + ), + ), + ("Unusual", "Unusual modules being used {names}", "Warning", ("argparse",)), + ("Ignored", None, None, ("os", "sys", "lxml")), +) + + +class PackageInxFile(InxFile): + def __init__(self, filename): + super().__init__(filename) + self.inx_file = filename + + def get_file_root(self): + return os.path.dirname(self.inx_file) + + def get_script(self): + """Return the file the INX points to""" + if self.script.get("location", None) in ("inx", None): + return os.path.join(self.get_file_root(), self.script["script"]) + raise IOError("Can't find script filename") + + +class IncludeFile(object): + """A file to include in the package""" + + def __init__(self, root, filepath, target=None): + self.root = root + self.filepath = filepath + self.name = os.path.basename(filepath) + self.target = target or os.path.dirname(filepath) + + def __repr__(self): + return f"<File name='{self.name}'>" + + def file_icon(self): + """Return a filename type""" + ext = self.filepath.rsplit(".", 1)[-1] + if ext in ("inx", "py", "txt", "svg", "png"): + return ext + return "default" + + def detect_deps(self, modules=False): + if not self.filepath.endswith(".py"): + return [], [] + # We want to find all modules imported by the script directly + # So we set the location to nowhere and collect the badmodules + finder = ModuleFinder("never-land") + finder.run_script(self.filepath) + # TODO: split out local modules, system modules and genuine deps + + deps, mods = [], [] + for key, locs in finder.badmodules.items(): + if "__main__" not in locs: + continue + try: + mod_path = finder.find_module("inkman", path=sys.path)[1] + if "/python" in mod_path: + if "site-packages" in mod_path: + deps.append(key.split(".")[0]) + elif mod_path.startswith(self.root): + mods.append(mod_path) + except ImportError: + continue + return mods, deps + + +class GeneratePackage(object): + """A generated package based on data""" + + def __init__(self, inx_files, template=os.path.join(DATA_DIR, "setup.template")): + with open(template, "r") as fhl: + self._template = fhl.read() + self.files = [] + self.requires = set() + self.warnings = defaultdict(list) + self.name = "" + self.ident = "" + + for x, inx_file in enumerate(inx_files): + try: + inx = PackageInxFile(inx_file) + except Exception as err: + self.add_warning(f"Can't add file {inx_file}: {err}", 5) + continue + self._add_file(inx.get_file_root(), inx.inx_file) + self._add_file(inx.get_file_root(), inx.get_script()) + if not x: + self.name = inx.name or "" + self.ident = inx.ident.replace(".", "-") + + def _add_file(self, root, fname): + included = IncludeFile(root, fname) + self.files.append(included) + (mods, deps) = included.detect_deps() + for dep in deps: + self._add_dep(dep) + for fname in mods: + self._add_file(root, fname) + print(f"DEP: {self.requires}") + + def _add_dep(self, name): + """Try and find the package associated with this name""" + for (list_name, warning, level, mod_list) in MODULES: + if name in mod_list: + self.warnings[list_name].append(name) + return + self.requires.add(name) + + def generate_setup(self, target): + """Generates a setup.py file contents""" + args = { + "__pkgname__": __pkgname__, + "__version__": __version__, + "year": datetime.now().year, + "readme": self.generate_readme(target), + "ident": self.generate_ident(), + "version": self.generate_version(), + "description": self.widget("entry_name").get_text(), + "author": self.widget("entry_author").get_text(), + "author_email": self.widget("entry_email").get_text(), + "url": self.widget("entry_url").get_text(), + "license": self.widget("licenses").get_active_id(), + "datafiles": self.generate_datafiles(), + "requires": self.generate_requires(), + "classifiers": "", # TODO + } + return self_template.format(**args) + + def generate_ident(self): + """Generate the ident from the text entry""" + ident = self.widget("entry_ident").get_text() + ident = ident.replace(" ", "-").lower() + self.widget("entry_ident").set_text(ident) + return "inx-" + ident + + def generate_datafiles(self): + """Generate a list of datafile and their install location""" + result = "" + template = " ('{target}', ['{file}']),\n" + # 2. Loop through all the file objects in the list + # 3. Add them to the final result + return result.strip() + + def generate_requires(self): + """Generate a list of required modules""" + # TODO: Version keeping + result = "" + # 1. Loop through all the dep objects in the list + # 2. Append them to the result + return result + + +if __name__ == "__main__": + gen = GeneratePackage(sys.argv[1:]) diff --git a/share/extensions/other/inkman/inkman/gui/__init__.py b/share/extensions/other/inkman/inkman/gui/__init__.py new file mode 100644 index 0000000..042956e --- /dev/null +++ b/share/extensions/other/inkman/inkman/gui/__init__.py @@ -0,0 +1,32 @@ +# +# Copyright 2018-2022 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/> +# +"""All graphical interfaces bound into a GtkApp""" + +import os + +from inkex.gui import GtkApp + +from .main import ExtensionManagerWindow +from .info import MoreInformation + + +class ManagerApp(GtkApp): + """Load the inkscape extensions glade file and attach to window""" + + ui_dir = os.path.join(os.path.dirname(__file__), "..", "data") + app_name = "inkscape-extensions-manager" + windows = [ExtensionManagerWindow, MoreInformation] diff --git a/share/extensions/other/inkman/inkman/gui/info.py b/share/extensions/other/inkman/inkman/gui/info.py new file mode 100644 index 0000000..5e17923 --- /dev/null +++ b/share/extensions/other/inkman/inkman/gui/info.py @@ -0,0 +1,105 @@ +# +# Copyright 2018-2022 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/> +# +"""Information about a package""" + +import os +import sys + +from inkex.gui import ChildWindow, TreeView + + +class ExtensionTreeItem(object): + """Shows the name of the item in the extensions tree""" + + def __init__(self, name, kind="debug", parent=None): + self.kind = kind + self.name = str(name) + + +class ExtensionTreeView(TreeView): + """A list of extensions (inx file based)""" + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.parents = {} + self.menus = {} + + def setup(self, *args, **kwargs): + self.ViewColumn("Name", expand=True, text="name") + self.ViewSort(data=lambda item: item.name, ascending=True) + + def get_menu(self, parent, *remain): + menu_id = "::".join([str(r) for r in remain]) + if menu_id in self.menus: + return self.menus[menu_id] + + if remain[:-1]: + parent = self.get_menu(parent, *remain[:-1]) + + menu = self._add_item([ExtensionTreeItem(remain[-1])], parent=parent) + self.menus[menu_id] = menu + return menu + + def add_item(self, item, parent=None): + if not item or not item.name: + return None + if item.kind not in self.parents: + tree_item = ExtensionTreeItem(item.kind.title()) + self.parents[item.kind] = self._add_item([tree_item], parent=None) + parent = self.parents[item.kind] + if item.kind == "effect" and len(item.menu) > 1: + parent = self.get_menu(parent, *item.menu[:-1]) + return self._add_item([item], parent) + + +class MoreInformation(ChildWindow): + """Show further information for an installed package""" + + name = "info" + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.inx = ExtensionTreeView(self.widget("inx"), selected=self.select_inx) + + def load_widgets(self, pixmaps, item): + """Initialise the information""" + try: + self.widget("info_website").show() + self.widget("info_website").set_uri(item.link) + self.widget("info_website").set_label(item.link) + except Exception: + self.widget("info_website").hide() + + self.pixmaps = pixmaps + self.window.set_title(item.name) + self.widget("info_name").set_label(item.name) + self.widget("info_desc").set_label(item.summary) + self.widget("info_version").set_label(item.version) + self.widget("info_license").set_label(item.license) + self.widget("info_author").set_label(f"{item.author}") + try: + self.widget("info_image").set_from_pixbuf(pixmaps.get(item.get_icon())) + except Exception: + pass + + self.inx.clear() + if hasattr(item, "get_files"): + for fn in item.get_files(filters=("*.inx",)): + self.inx.add([ExtensionTreeItem(fn, kind="lost-and-found")]) + + def select_inx(self, item): + pass diff --git a/share/extensions/other/inkman/inkman/gui/main.py b/share/extensions/other/inkman/inkman/gui/main.py new file mode 100644 index 0000000..9ff8065 --- /dev/null +++ b/share/extensions/other/inkman/inkman/gui/main.py @@ -0,0 +1,371 @@ +# +# 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/> +# +"""Gtk 3+ Inkscape 1.0 Extensions Manager GUI.""" + +import os +import sys +import webbrowser + +from inkex.gui import Window, ChildWindow, TreeView, asyncme +from inkex.gui.pixmap import PixmapManager +from inkex.gui.app import Gtk + +from ..utils import DATA_DIR, INKSCAPE_PROFILE +from ..remote import RemoteArchive, SearchError +from .. import __state__ + + +def tag(name, color="#EFEFEF", fgcolor="#333333"): + return f"<span size='small' font_family='monospace' style='italic' background='{color}' foreground='{fgcolor}'> {name} </span> " + + +class LocalTreeView(TreeView): + """A List of locally installed packages""" + + def __init__(self, target, widget, *args, **kwargs): + self._target = target + self._pixmaps = kwargs["pixmaps"] + self._version = kwargs.pop("version", None) + + style = widget.get_style_context() + self._fg_color = style.get_color(Gtk.StateFlags.NORMAL) + # self._bg_color = style.get_property('background-color', Gtk.StateFlags.NORMAL) + + super().__init__(widget, *args, **kwargs) + + def get_name(self, item): + # color = self._style.get_property('color', Gtk.StateFlags.NORMAL) + return f"<big><b>{item.name}</b></big>\n<i>{item.summary}</i>" + + def get_icon(self, item): + try: + return self._pixmaps.get(item.get_icon(), "") + except Exception: + return "" + + def setup(self, *args, **kwargs): + """Setup the treeview with one or many columns manually""" + + col = self.create_column("Extensions Package", expand=True) + + img = col.add_image_renderer(self.get_icon, pad=0, pixmaps=self._pixmaps) + img.set_property("ypad", 2) + + txt = col.add_text_renderer(self.get_name) + txt.set_property("foreground-rgba", self._fg_color) + # This is detected as black for remote treeview, we're not sure why + # txt.set_property("background-rgba", self._bg_color) + txt.set_property("xpad", 8) + + col = self.create_column("Version", expand=False) + txt = col.add_text_renderer("version", template=f"<i>{0}</i>") + txt.set_property("foreground-rgba", self._fg_color) + + col = self.create_column("Author", expand=False) + txt = col.add_text_renderer("author") + txt.set_property("foreground-rgba", self._fg_color) + + if self._target.version_specific: + col = self.create_column("Inkscape", expand=False) + txt = col.add_text_renderer("target") + txt.set_property("foreground-rgba", self._fg_color) + + self.create_sort(data=lambda item: item.name, ascending=True, contains="name") + + super().setup(*args, **kwargs) + + +class RemoteTreeView(LocalTreeView): + """A List of remote packages for installation""" + + def get_installed(self, item): + if item.installed is None: + item.set_installed(False) + for installed_item in self._target.list_installed(): + if item.ident == installed_item.ident: + item.set_installed(True) + return bool(item.installed) + + def setup(self, *args, **kwargs): + def get_star(item): + star = "star-none.svg" + if item.stars > 10: + star = "star-lots.svg" + elif item.stars > 1: + star = "star-some.svg" + return self._pixmaps.get(star) + + def get_sort(item): + if not item.verified: + return -100 + item.stars + if self._version not in item.targets: + return -20 + item.stars + return item.stars + (1000 * int(item.recommended)) + + super().setup(*args, **kwargs) + + col = self.create_column("Stars", expand=True) + img = col.add_image_renderer(get_star, pad=0, size=16, pixmaps=self._pixmaps) + img.set_property("ypad", 2) + txt = col.add_text_renderer("stars") + txt.set_property("foreground-rgba", self._fg_color) + + self.create_sort(data=get_sort, ascending=True) + + def get_name(self, item): + summary = item.summary + if self.get_installed(item): + summary = tag("Installed", "#37943e", "white") + summary.strip() + elif not item.verified: + summary = tag("Unverified", "#CB0000", "white") + summary.strip() + elif self._version not in item.targets: + targets = item.targets or ["No Inkscape Versions"] + summary = ( + "".join([tag(t, "#00CB00", "white") for t in targets]) + summary.strip() + ) + else: + summary = ( + tag("Verified", "#37943e", "white") + + tag(self._version, "#37943e", "white") + + summary.strip() + ) + + return f"<big><b>{item.name}</b></big>\n<i>{summary}</i>\n" + "".join( + tag(t) for t in item.tags + ) + + +class LocalPixmaps(PixmapManager): + """Load local pictures""" + + pixmap_dir = DATA_DIR + + +class ExtensionManagerWindow(Window): + name = "gui" + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.target = self.gapp.kwargs["target"] + self._version = self.gapp.kwargs["version"] + + self.pixmaps = LocalPixmaps("pixmaps", size=48, load_size=(96, 96)) + self.searching = self.widget("dl-searching") + self.searchbox = self.searching.get_parent() + self.searchbox.remove(self.searching) + + self.local = LocalTreeView( + self.target, + self.widget("local_extensions"), + version=self._version, + pixmaps=self.pixmaps, + selected=self.select_local, + ) + + self.remote = RemoteTreeView( + self.target, + self.widget("remote_extensions"), + version=self._version, + pixmaps=self.pixmaps, + selected=self.select_remote, + ) + + self.widget("loading").start() + self.window.show_all() + self.window.present() + # self.window.set_keep_above(True) + + self.refresh_local() + self.widget("remote_install").set_sensitive(False) + self.widget("remote_info").set_sensitive(False) + self.widget("local_install").set_sensitive(True) + self.window.set_title(self.target.label + f" ({self._version}) - {__state__}") + + if not self.target.is_search: + self.widget("remote_getlist").show() + self.widget("dl-search").hide() + else: + self.widget("dl-search").show() + self.widget("remote_getlist").hide() + self.widget("no_results").hide() + + # Get a tasting of items from the server + self._remote_search(None) + + def remote_getlist(self, widget): + self._remote_search("") + + @asyncme.run_or_none + def refresh_local(self): + """Searches for locally installed extensions and adds them""" + self.local.clear() + self.widget("local_uninstall").set_sensitive(False) + self.widget("local_information").set_sensitive(False) + + all_packages = [] + for item in self.target.list_installed(cached=False): + self.local.add_item(item) + self.widget("loading").stop() + + def select_local(self, item): + """Select an installed extension""" + self.widget("local_uninstall").set_sensitive(item.is_uninstallable()) + self.widget("local_information").set_sensitive(bool(item)) + + def local_information(self, widget): + """Show the more information window""" + if self.local.selected: + self.load_window("info", pixmaps=self.pixmaps, item=self.local.selected) + + def local_uninstall(self, widget): + """Uninstall selected extection package""" + item = self.local.selected + if item.is_uninstallable(): + if item.uninstall(): + self.local.remove_item(item) + self.remote.refresh() + + def change_remote_all(self, widget, unk): + """When the source switch button is clicked""" + self.remote_search(self.widget("dl-search")) + + def remote_search(self, widget): + """Remote search activation""" + query = widget.get_text() + if len(query) > 2: + self._remote_search(query) + + def _remote_search(self, query): + filtered = False # self.widget('remote_target').get_active() + self.remote.clear() + self.widget("no_results").hide() + self.widget("results_found").show() + self.widget("remote_install").set_sensitive(False) + self.widget("remote_info").set_sensitive(False) + self.widget("dl-search").set_sensitive(False) + self.searchbox.add(self.searching) + self.widget("dl-searching").start() + self.async_search(query, filtered) + + def remote_info(self, widget): + """Show the remote information""" + if self.remote.selected and self.remote.selected.link: + webbrowser.open(self.remote.selected.link) + + @asyncme.run_or_none + def async_search(self, query, filtered): + """Asyncronous searching in PyPI""" + try: + for package in self.target.search(query, filtered): + self.add_search_result(package) + except SearchError as err: + # Ignore taster request + if query is not None: + self.dialog(str(err)) + self.search_finished() + + @asyncme.mainloop_only + def add_search_result(self, package): + """Adding things to Gtk must be done in mainloop""" + self.remote.add_item(package) + + @asyncme.mainloop_only + def search_finished(self): + """After everything, finish the search""" + self.searchbox.remove(self.searching) + self.widget("dl-search").set_sensitive(True) + self.replace(self.searching, self.remote._list) + if not self.remote._model.iter_n_children(): + self.widget("no_results").show() + self.widget("results_found").hide() + + def select_remote(self, item): + """Select an installed extension""" + # Do we have a place to install packages to? + active = ( + self.remote.selected + and self.remote.selected.is_installable(self._version) + and not self.remote.selected.installed + ) + self.widget("remote_install").set_sensitive(active) + if self.remote.selected.link: + self.widget("remote_info").set_sensitive(True) + + def remote_install(self, widget): + """Install a remote package""" + self.widget("remote_install").set_sensitive(False) + item = self.remote.selected + try: + item.install() + except Exception as err: + self.dialog(str(err)) + return + self.remote.refresh() + self.refresh_local() + self.widget("main_notebook").set_current_page(0) + + def local_install(self, widget): + """Install from a local filename""" + dialog = Gtk.FileChooserDialog( + title="Please choose a package file", + transient_for=self.window, + action=Gtk.FileChooserAction.OPEN, + ) + + dialog.add_buttons( + Gtk.STOCK_CANCEL, + Gtk.ResponseType.CANCEL, + Gtk.STOCK_OPEN, + Gtk.ResponseType.OK, + ) + + filter_py = Gtk.FileFilter() + filter_py.set_name("Packages") + filter_py.add_mime_type("application/x-compressed-tar") + filter_py.add_mime_type("application/zip") + dialog.add_filter(filter_py) + + filter_text = Gtk.FileFilter() + filter_text.set_name("Python Wheel") + filter_text.add_mime_type("application/zip") + filter_text.add_pattern("*.whl") + dialog.add_filter(filter_text) + + filter_any = Gtk.FileFilter() + filter_any.set_name("Any files") + filter_any.add_pattern("*") + dialog.add_filter(filter_any) + + response = dialog.run() + if response == Gtk.ResponseType.OK: + self.target._install(dialog.get_filename(), {}) + self.refresh_local() + + dialog.destroy() + + def update_all(self, widget=None): + """Update the extensions manager, and everything else""" + pass + + def dialog(self, msg): + self.widget("dialog_msg").set_label(msg) + self.widget("dialog").set_transient_for(self.window) + self.widget("dialog").show_all() + + def close_dialog(self, widget): + self.widget("dialog_msg").set_label("") + self.widget("dialog").hide() diff --git a/share/extensions/other/inkman/inkman/package.py b/share/extensions/other/inkman/inkman/package.py new file mode 100644 index 0000000..a19127e --- /dev/null +++ b/share/extensions/other/inkman/inkman/package.py @@ -0,0 +1,330 @@ +# +# Copyright (C) 2019 Martin Owens +# +# 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +""" +Support for constructing and understanding installed extensions +as python packages. + +Start by using 'PackageLists' and iterate over to get 'PackageList' objects +iterate over those to get 'Package' objects and use those to know more +information about the installed packages. +""" + +import os +import sys +import json +import logging +from fnmatch import fnmatch + +from .utils import ( + DATA_DIR, + ICON_SEP, + parse_metadata, + clean_author, + get_user_directory, + get_inkscape_directory, + ExtensionInx, +) + +# The ORDER of these places is important, when installing packages it will +# choose the FIRST writable directory in the lsit, so make sure that the +# more preferable locations appear at the top. +EXTENSION_PLACES = [] + +for path in sys.path: + if "extensions" in path: + if "/bin" in path: + path = path.replace("/bin", "") + EXTENSION_PLACES.append(path) + +CORE_ICON = os.path.join(DATA_DIR, "pixmaps", "core_icon.svg") +ORPHAN_ICON = os.path.join(DATA_DIR, "pixmaps", "orphan_icon.svg") +DEFAULT_ICON = os.path.join(DATA_DIR, "pixmaps", "default_icon.svg") +MODULE_ICON = os.path.join(DATA_DIR, "pixmaps", "module_icon.svg") + + +class PackageItem(object): + """ + Gets information about the package using requests. + + Can be remote, or local json file. + """ + + default_icon = DEFAULT_ICON + + @classmethod + def is_pkg(cls, info): + """Returns true if this info package is considered a managed package""" + for field in ("name", "author", "verified", "links", "summary"): + if field not in info: + return False + return True + + def __init__(self, info, remote=None): + if not self.is_pkg(info): + raise ValueError("Not a valid package, refusing to create it.") + + self.info = info + self.remote = remote + self.installed = None + self._installer = None + self._uninstaller = None + self._missing = [] + self._icon = None + + ident = property(lambda self: self.info.get("id")) + url = property(lambda self: self.info["links"]["file"]) + link = property(lambda self: self.info["links"]["html"]) + name = property(lambda self: self.info["name"] or "Unnamed") + license = property(lambda self: self.info.get("license") or "") + author = property(lambda self: self.info["author"]) + tags = property(lambda self: self.info.get("tags", [])) + + stars = property(lambda self: self.info["stats"]["liked"]) + downloads = property(lambda self: self.info["stats"]["downloaded"]) + verified = property(lambda self: self.info["verified"]) + recommended = property(lambda self: self.info["stats"].get("extra", 0) == 7) + + targets = property(lambda self: self.info.get("Inkscape Version", [])) + target = property(lambda self: ", ".join(self.targets)) + + @property + def summary(self): + ret = self.info["summary"] or "No summary" + if len(ret) > 110: + ret = ret.split(". ", 1)[0] + if len(ret) > 110: + ret = ret[:110].rsplit(" ", 1)[0] + "..." + return ret + + @property + def version(self): + if "version" in self.info: + return str(self.info["version"]) + if "stats" in self.info and "revisions" in self.info["stats"]: + return str(int(self.info["stats"]["revisions"]) + 1) + return "?" + + def set_installer(self, fn): + self._installer = fn + + def set_uninstaller(self, fn, *args): + def _inner(info): + return fn(info, *args) + + self._uninstaller = _inner + + def set_installed(self, installed=True): + self.installed = installed + + def is_installable(self, version): + if version not in self.targets or not self.verified: + return False + return bool(not self.installed and self._installer) + + def is_uninstallable(self): + return bool(self._uninstaller) + + def install(self): + """Install the remote package""" + if not self.remote: + raise IOError("Can not install without a defined remote") + url = self.remote(self.info["links"]["file"]) + msg = self._installer(url.as_local_file(), self.info) + self.set_installed(True) + return msg + + def uninstall(self): + """Remove the pakage if possible""" + if self._uninstaller(self.info): + self.set_installed(False) + return True + return False + + def get_icon(self): + if self._icon: + return self._icon + if self.info.get("icon"): + if not self.remote: + raise IOError("Can get icon without a defined remote") + icon = self.remote(self.info["icon"]) + self._icon = icon.as_local_file() or self.default_icon + return self._icon + for filename in self.get_files(): + name = os.path.basename(filename) + if name in ("icon.svg", "icon.png"): + self._icon = os.path.abspath(filename) + return filename + return self.default_icon + + def get_files(self, missing=False): + """List files""" + return [ + name + for name in self.info.get("files", []) + if missing or name not in self._missing + ] + + +class OrphanedItem(PackageItem): + """ + A special kind of item to collect all orphaned files + """ + + default_icon = ORPHAN_ICON + + def __init__(self, parent): + super().__init__( + { + "name": "Orphan Extensions", + "author": "Various", + "verified": False, + "summary": "Old and manually installed extensions", + "license": "Unknown", + "links": {}, + "version": "-", + "stats": {"liked": -1, "downloaded": -1}, + } + ) + + self._icon = self.default_icon + self._parent = os.path.abspath(parent) + self._files = set() + self._removed = set() + self._items = {} + + def _get_target_file(self, filename): + if not os.path.isabs(filename): + filename = os.path.join(self._parent, filename) + path = os.path.abspath(filename) + return path.replace(self._parent, "").lstrip("/") + + def add_file(self, filename): + """Add a file to the 'this file exists' list""" + self._files.add(self._get_target_file(filename)) + + def remove_file(self, filename, item=None): + """Add a file to the 'this file is said to exist' list""" + fn = self._get_target_file(filename) + self._removed.add(fn) + if item is not None: + self._items[fn] = item + + def get_files(self, filters=()): + """Returns a filtered set of files which exist, minus ones said to exist""" + if not filters: + filters = ("*",) + items = [] + for item in self._files - self._removed: + if any([fnmatch(item, filt) for filt in filters]): + items.append(item) + return items + + def get_missing(self): + """Returns a set of files which don't exist, even though they were said to""" + return [(fn, self._items.get(fn, None)) for fn in self._removed - self._files] + + +class PythonItem(PackageItem): + """ + A python package that has an inx file, but was never installed properly. + """ + + def __init__(self, pip): + self.pip = pip + info = self.pip.get_metadata() + super().__init__( + { + "pip": True, + "name": info["name"], + "summary": info["summary"], + "author": info["author"] or "Unknown", + "version": info["version"], + "license": info["license"], + "verified": False, + "links": {}, + "stats": {"liked": -1, "downloaded": -1}, + } + ) + + def get_files(self): + return self.pip.package_files() + + +class PythonPackage(object): + """ + A reprisentation of the python package, NOT the json based packages. + """ + + name = property(lambda self: self.get_metadata()["name"]) + version = property(lambda self: self.get_metadata()["version"]) + + def __init__(self, path, parent): + self._metadata = None + self.path = path + self.parent = parent + + def get_inx(self): + """Yields all of the inx files in this package""" + for filename in self.package_files(): + if filename.endswith(".inx"): + yield filename + + def package_files(self): + """Return a generator of all files in this installed package""" + parent = os.path.abspath(os.path.dirname(self.path)) + record = self.get_file("RECORD") + if not record: + return + for line in record.split("\n"): + if line and "," in line: + (filename, checksum, size) = line.rsplit(",", 2) + # XXX Check filesize or checksum? + if not os.path.isabs(filename): + filename = os.path.join(parent, filename) + yield filename + + def get_metadata(self): + """Returns the metadata from an array of known types""" + if self._metadata is None: + for name in ("METADATA", "PKG-INFO"): + md_mail = self.get_file(name) + if md_mail: + self._metadata = parse_metadata(md_mail) + + if self._metadata is None: + md_json = self.get_file("metadata.json") + if md_json: + self._metadata = clean_author(json.loads(md_json)) + + if self._metadata is None: + raise KeyError("Can't find package meta data: {}".format(self.path)) + return self._metadata + + def get_file(self, name): + """Get filename if it exists""" + if not self.path or not os.path.isdir(self.path): + return None + path = os.path.join(self.path, name) + if os.path.isfile(path): + with open(path, "r") as fhl: + return fhl.read() + return None + + def get_depedencies(self): + """Return a list of other pip packages this packages needs""" + return self.get_metadata()["requires"] diff --git a/share/extensions/other/inkman/inkman/remote.py b/share/extensions/other/inkman/inkman/remote.py new file mode 100644 index 0000000..c2c4b54 --- /dev/null +++ b/share/extensions/other/inkman/inkman/remote.py @@ -0,0 +1,153 @@ +# +# Copyright (C) 2019-2021 Martin Owens +# +# 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +""" +Searching for external packages and getting meta data about them. +""" + +import re +import os +import json +import logging +import requests + +try: + from cachecontrol import CacheControl, CacheControlAdapter + from cachecontrol.caches.file_cache import FileCache + from cachecontrol.heuristics import ExpiresAfter +except (ImportError, ModuleNotFoundError): + CacheControl = None + +from inkex.command import CommandNotFound, ProgramRunError, call +from collections import defaultdict + +from .utils import INKSCAPE_VERSION, CACHE_DIR +from .package import DEFAULT_ICON, PackageItem + +PYTHON_VERSION = "py3" + +class SearchError(IOError): + pass + +class LocalFile(object): + """Same API as RemoteFile, but for locals""" + + def __init__(self, basedir, url): + self.basedir = basedir + self.url = url + + def __str__(self): + return self.url + + def filename(self): + return self.url.split("/")[-1] + + def filepath(self): + return os.path.join(self.basedir, self.url) + + def as_local_file(self): + filename = self.filepath() + if os.path.isfile(filename): + return filename + raise IOError(f"Can't find file: {filename}") + + +class RemoteFile(object): + """A remote file, icon, zip etc""" + + def __init__(self, session, url): + self.session = session + self.url = url + + def __str__(self): + return self.url + + def get(self): + return self.session.get(self.url) + + def filename(self): + return self.url.split("/")[-1] + + def filepath(self): + return os.path.join(CACHE_DIR, self.filename()) + + def as_local_file(self): + if self.url: + remote = self.get() + if remote and remote.status_code == 200: + with open(self.filepath(), "wb") as fhl: + fhl.write(remote.content) + return self.filepath() + return None + + +class RemoteArchive(object): + """The remote archive used to be PyPI but is now inkscape's own website.""" + + URL = "https://inkscape.org/gallery/={category}/json/" + + def __init__(self, category, version=INKSCAPE_VERSION): + self.version = version + self.url = self.URL.format(category=category) + self.session = requests.session() + if CacheControl is not None: + self.session.mount( + "https://", + CacheControlAdapter( + cache=FileCache(CACHE_DIR), + heuristic=ExpiresAfter(days=1), + ), + ) + + def _remote_file(self, url): + return RemoteFile(self.session, url) + + def search(self, query, filtered=True): + """Search for extension packages""" + for info in self._search(query): + item = PackageItem(info, remote=self._remote_file) + if not filtered or not self.version or self.version in item.targets: + yield item + + def _search(self, query, tags=[]): + """Search for the given query and yield each item, will raise if any other response""" + response = None + + if query is None: + try: + response = self.session.get( + self.url, + params={ + "tags": tags, + "checked": 1, + "limit": 10, + "order": "extra_status", + }, + ) + except requests.exceptions.RequestException as err: + raise SearchError(str(err)) + except ConnectionError as err: + raise SearchError(str(err)) + except requests.exceptions.RequestsWarning: + pass + else: + response = self.session.get( + self.url, params={"q": query, "tags": tags, "checked": 1} + ) + if response is not None: + for item in response.json()["items"]: + yield item diff --git a/share/extensions/other/inkman/inkman/target.py b/share/extensions/other/inkman/inkman/target.py new file mode 100644 index 0000000..dff1211 --- /dev/null +++ b/share/extensions/other/inkman/inkman/target.py @@ -0,0 +1,375 @@ +# +# Copyright (C) 2019 Martin Owens +# +# 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +""" +Target a directory to install resources into. +""" + +import os +import sys +import json +import logging +from shutil import which + +from inkex.inx import InxFile +from inkex.command import call, CommandNotFound, ProgramRunError + +from .archive import Archive, UnrecognizedArchiveFormat +from .remote import RemoteArchive, LocalFile +from .utils import INKSCAPE_PROFILE, CACHE_DIR, ExtensionInx +from .package import PackageItem, OrphanedItem, PythonItem, PythonPackage + + +class BasicTarget(object): + """ + A location where to install something, plus how to search for it. + """ + + version_specific = False + + def __init__(self, category, label, path, is_search=False, filters=()): + self.category = category + self.label = label + self.path = os.path.join(INKSCAPE_PROFILE, path) + self.is_search = is_search + self.archive = RemoteArchive(category) + self.filters = filters + self._installed = None + + def search(self, query, filtered=False): + """Search the online archive for things""" + for pkg in self.archive.search(query, filtered): + pkg.set_installer(self._install) + yield pkg + + def is_writable(self): + """Can the folder be written to (for installation)""" + try: + return os.access(self.path, os.W_OK) + except IOError: + return False + + def _install(self, filename, info): + if not info.get("id"): + info["id"] = self.generate_id(filename) + + if not info.get("id"): + raise ValueError("Id is a required field for packages") + + if filename.endswith(".zip"): + location = info["id"] + fname = "info.json" + info["files"] = list(self.install_zip_files(filename, location)) + else: + location = "pkg" + fname = info["id"] + ".json" + info["files"] = [self.write_file(filename, os.path.basename(filename))] + + self.write_file(json.dumps(info).encode("utf8"), fname, extra=location) + + return f"Package installed! Remember to restart inkscape to use it!" + + def _uninstall(self, info, json_file): + self._installed = None + for fname in info.get("files"): + self.remove_file(fname) + if json_file and os.path.isfile(json_file): + self.remove_file(json_file) + return True + + def install_zip_files(self, filename, location): + """Install the files in the zip filename as non-pip files""" + with Archive(filename) as archive: + for filename in archive.filenames(): + yield self.write_file(archive.read(filename), filename, extra=location) + + def generate_id(self, filename): + """User submitted zip file, generate an id as best we can""" + return filename.replace(".zip", "") + + def list_installed(self, cached=True): + """ + Loops through all the files in the target path and finds all the installed items. + """ + if cached and self._installed: + yield from self._installed + return + + self._installed = [] + for item in self._list_installed(): + self._installed.append(item) + yield item + + def _list_installed(self): + orphans = OrphanedItem(self.path) + for root, subs, files in os.walk(self.path): + for fname in files: + fpath = os.path.join(root, fname) + name = self.unprefix_path(fpath) + if fname.endswith(".json"): + if os.path.basename(fpath) == "package.json": + continue + with open(fpath, "rb") as fhl: + data = fhl.read() + info = json.loads(data) + if not PackageItem.is_pkg(info): + continue + + item = PackageItem( + info, remote=self._remote_or_local_file(root) + ) + item.set_uninstaller(self._uninstall, fpath) + yield item + + for pkg_file in item.get_files(missing=True): + orphans.remove_file(pkg_file, item) + orphans.remove_file(os.path.join(root, pkg_file), item) + else: + orphans.add_file(name) + + for fname, item in orphans.get_missing(): + if item is not None: + item._missing.append(fname) + + if orphans.get_files(filters=self.filters): + yield orphans + + def _remote_or_local_file(self, basedir): + # If a json file specifies something that's local, it's "ALWAYS" local to the + # json file as a basedir. + def _inner(url): + if "://" not in url: + return LocalFile(basedir, url) + return self.archive._remote_file(url) + + return _inner + + def write_file(self, source, source_name=None, extra=None): + target = os.path.join(self.path, extra) if extra else self.path + + if isinstance(source, str): + if not source_name: + source_name = source + with open(source, "rb") as fhl: + source = fhl.read() + + path = os.path.join(target, source_name) + filedir = os.path.dirname(path) + if not os.path.isdir(filedir): + os.makedirs(filedir) + + # Ignore paths + if not os.path.isdir(path): + with open(path, "wb") as whl: + whl.write(source) + + return self.unprefix_path(path) + + def remove_file(self, filename): + """ + Remove the given file and clean up + """ + if not filename.startswith(self.path): + filename = os.path.join(self.path, filename) + if os.path.isfile(filename): + os.unlink(filename) + + # Recursively clean up directories (if empty) + path = os.path.dirname(filename) + while path.lstrip("/") != self.path.lstrip("/"): + if os.listdir(path): + break + os.rmdir(path) + path = os.path.dirname(path) + + def unprefix_path(self, path): + """ + Removes the prefix of the given path, if it's based in self.path + """ + # Strip just the OS seperator, but what if the files were moved from another OS? + return path.replace(self.path, "").lstrip("/").lstrip("\\") + + +class ExtensionsTarget(BasicTarget): + """ + Extra functional target for extensions (pip based) + """ + + version_specific = True + + def get_pip(self): + path = os.path.abspath(os.path.join(self.path, "bin")) + return which("pip", path=path + ":" + os.environ["PATH"]) + + def _install(self, filename, info): + if self.is_pip_package(filename): + results = self.pip_install(filename) + if results: + info["pip"] = True + info["id"] = results.strip().split()[-1] + fname = info["id"] + ".json" + self.write_file(json.dumps(info).encode("utf8"), fname, extra="lib") + return ( + f"Python Package installed! Remember to restart inkscape to use it!" + ) + return f"Failed to install, something is wrong with your setup." + + return super()._install(filename, info) + + def _uninstall(self, info, json_file): + self._installed = None + if not info.get("pip"): + return super()._uninstall(info, json_file) + self.pip_uninstall(info["name"]) + if json_file and os.path.isfile(json_file): + self.remove_file(json_file) + return True + + def is_pip_package(self, filename): + """Return true if this is a detectable pip package""" + if filename.endswith(".whl"): + return True + try: + with Archive(filename) as archive: + for filename in archive.filenames(): + if filename.endswith("setup.py"): + return True + except UnrecognizedArchiveFormat: + return False + return False + + def pip_install(self, filename): + """Install the filename as a pip package""" + pip = self.get_pip() + if pip is None: + logging.error( + "This package requires python VirtualEnv which is not available on your system." + ) + return None + try: + results = call( + pip, + "install", + ("isolated", True), + ("disable-pip-version-check", True), + ("cache-dir", CACHE_DIR), + filename, + ).decode("utf8") + except ProgramRunError as err: + raise + return results + + def pip_uninstall(self, name): + """Uninstall the given pip package name""" + try: + results = call( + self.get_pip(), "uninstall", ("disable-pip-version-check", True), name + ).decode("utf8") + except ProgramRunError as err: + raise + return results + + def generate_id(self, filename): + """Extensions have an id internally, try and use it""" + try: + with Archive(filename) as archive: + inxes = [item for item in archive.filenames() if item.endswith(".inx")] + if not inxes: + raise IOError("Refusing to install extension without inx file!") + inx = ExtensionInx(archive.read(inxes[0]).decode("utf-8")) + return inx.ident + except UnrecognizedArchiveFormat: + raise IOError( + "Refusing the install extension without inx file (unknown archive)" + ) + except: + raise IOError("Refusing the install extension with bad inx file!") + + def _list_installed(self): + """ + Add pip packages to file lists. + """ + orphans = None + packages = {} + all_deps = set() + all_files = set() + + # First collect a list of python packages installed + for node in self.get_python_paths(): + if node.endswith(".dist-info") or node.endswith(".egg-info"): + package = PythonPackage(node, self.path) + packages[package.name] = package + all_files |= set(package.package_files()) + for dep, _ in package.get_depedencies(): + all_deps.add(dep) + + # Now return all non pip packaged extensions (from super) + for item in super()._list_installed(): + if item.info.get("pip", False): + if self.info.ident not in packages: + print(f"Can't find python package: {item.ient}") + continue + + pip_pkg = packages[item.ident] + item.info["version"] = pip_pkg.version + + if isinstance(item, OrphanedItem): + orphans = item + else: + yield item + + # Remove all orphaned files that were installed by pip packages + if orphans is not None: + for fn in all_files: + orphans.remove_file(fn) + if orphans.get_files(filters=self.filters): + # Yield if we still have orphans + yield orphans + + # Now what to do with all these remaining packages, pretend their installed? + for name, package in packages.items(): + for inx in package.get_inx(): + item = PythonItem(package) + item.set_uninstaller(self._uninstall, None) + yield item + break + + for dep in all_deps: + if dep not in packages: + # These packages are often just installed into the system, nothing to say. + # XXX But, there is a future where pip could be interigated. + # logging.error(f"Missing python depedency: {dep}") + continue + packages.pop(dep) + + def get_python_paths(self): + """Returns paths related to the python packages""" + pyver = "python" + sys.version[:3] + for varient in [ + os.path.join(self.path, "lib", pyver, "site-packages"), + ]: + if os.path.isdir(varient): + for subpath in os.listdir(varient): + yield os.path.join(varient, subpath) + + def get_package(self, name, version=None): + """Test every package in this list if it matches the name and version""" + for package in self.iter(): + found = package.is_package(name, version=version) + if found: + return package + return None diff --git a/share/extensions/other/inkman/inkman/targets.py b/share/extensions/other/inkman/inkman/targets.py new file mode 100644 index 0000000..e7bed7c --- /dev/null +++ b/share/extensions/other/inkman/inkman/targets.py @@ -0,0 +1,20 @@ +""" +Definition of available Inkscape target directories and their machinery +""" + +from .target import ExtensionsTarget, BasicTarget + +TARGETS = [ + # Website slug, Visible name, local directory, search instead of list + ExtensionsTarget("extension", "Extensions", "extensions", True, filters=("*.inx",)), + BasicTarget("template", "Templates", "templates", True, filters=("*.svg",)), + BasicTarget("palette", "Shared Paletts", "palettes", filters=("*.gpl",)), + BasicTarget("symbol", "Symbol Collections", "symbols", filters=("*.svg",)), + BasicTarget("keyboard", "Keyboard Shortcuts", "keys", filters=("*.xml",)), + # ('marker', 'Marker Collections', '', False), # No marker config + # ('pattern', 'Pattern Collections', '', False), # No pattern config + # ('', 'User Interface Themes', 'themes', False), # No website category + # ('', 'Paint Server', 'paint', False), # No website category + # ('', 'User Interfaces', 'ui', False), # No website category + # ('', 'Icon Sets', 'icons', False), # No website category +] diff --git a/share/extensions/other/inkman/inkman/utils.py b/share/extensions/other/inkman/inkman/utils.py new file mode 100644 index 0000000..f98f3b1 --- /dev/null +++ b/share/extensions/other/inkman/inkman/utils.py @@ -0,0 +1,166 @@ +# +# Copyright (C) 2019 Martin Owens +# +# 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 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +""" +Utilities functions for inkscape extension manager. +""" + +import os + +from collections import defaultdict +from email.parser import FeedParser +from appdirs import user_cache_dir + +from inkex.inx import InxFile +from inkex.command import inkscape, ProgramRunError, CommandNotFound + +DEFAULT_VERSION = "1.1" +CACHE_DIR = user_cache_dir("inkscape-extension-manager", "Inkscape") +INKSCAPE_VERSION = os.environ.get("INKSCAPE_VERSION", None) +INKSCAPE_PROFILE = os.environ.get("INKSCAPE_PROFILE_DIR", None) + +# This directory can be passed and used by inkscape to override it's +# profile directory for extensions +INKSCAPE_EXTENSIONS = os.environ.get("INKSCAPE_EXTENSIONS_DIR", None) + +if not INKSCAPE_PROFILE and "VIRTUAL_ENV" in os.environ: + INKSCAPE_PROFILE = os.path.dirname(os.environ["VIRTUAL_ENV"]) + +if not INKSCAPE_PROFILE and "APPDATA" in os.environ: + INKSCAPE_PROFILE = os.path.join(os.environ["APPDATA"], "inkscape") + +if not INKSCAPE_PROFILE and not INKSCAPE_EXTENSIONS: + raise ImportError("The Inkscape profile directory isn't set!") + +if not os.path.isdir(CACHE_DIR): + os.makedirs(CACHE_DIR) + +DATA_DIR = os.path.join(os.path.dirname(__file__), "data") +ICON_SEP = ("-" * 12) + "SVGICON" + ("-" * 12) + + +def _pythonpath(): + for pth in os.environ.get("PYTHONPATH", "").split(":"): + if os.path.isdir(pth): + yield pth + + +def get_user_directory(): + """Return the user directory where extensions are stored.""" + if INKSCAPE_EXTENSIONS: + return os.path.abspath(INKSCAPE_EXTENSIONS) + + if "INKSCAPE_PROFILE_DIR" in os.environ: + return os.path.abspath( + os.path.expanduser( + os.path.join(os.environ["INKSCAPE_PROFILE_DIR"], "extensions") + ) + ) + + home = os.path.expanduser("~") + for pth in _pythonpath(): + if pth.startswith(home): + return pth + + +def get_inkscape_directory(): + """Return the system directory where inkscape's core is.""" + for pth in _pythonpath(): + if os.path.isdir(os.path.join(pth, "inkex")): + return pth + + +def get_inkscape_version(): + """Attempt to detect the inkscape version""" + try: + line = inkscape(version=True, svg_file=None) + except (ProgramRunError, CommandNotFound): + return DEFAULT_VERSION + if isinstance(line, bytes): + line = line.decode("utf8") + (major, minor) = line.strip().split(" ")[1].split(".")[:2] + return "{}.{}".format(int(major), int(minor.split("-")[0])) + + +def format_requires(string): + """Get a version requires.""" + primary = string.split("; ", 1)[0] + if "(" in primary: + primary, version = primary.split("(", 1) + return (primary.strip(), version.strip(") ")) + return (primary.strip(), None) + + +def parse_metadata(data): + """ + Convert older email based meta data into a newer json format, + See PEP 566 for details. + """ + feed_parser = FeedParser() + feed_parser.feed(data) + metadata = feed_parser.close() + + def getdict(): + """Multi-dimentional dictionary""" + return defaultdict(getdict) + + ret = defaultdict(getdict) + + ret["description"] = metadata.get_payload() + ret["requires"] = [ + format_requires(m) for m in metadata.get_all("Requires-Dist", []) + ] + + for key, value in metadata.items(): + if key == "Home-page": + ret["extensions"]["python.details"]["project_urls"]["Home"] = value + elif key == "Classifier": + ret["classifiers"] = list(ret["classifiers"]) + ret["classifiers"].append(value) + else: + ret[key.lower().replace("-", "_")] = value + + return ret + + +def clean_author(data): + """Clean the author so it has consistant keys""" + for contact in ( + data.get("extensions", {}).get("python.details", {}).get("contacts", []) + ): + if contact["role"] == "author": + data["author"] = contact["name"] + data["author_email"] = contact.get("email", "") + if "<" in data["author"]: + data["author"], other = data["author"].split("<", 1) + if "@" in other and not data["author_email"]: + data["author_email"] = data["author"].split(">")[0] + return data + + +class ExtensionInx(InxFile): + """Information about an extension specifically""" + + ident = property(lambda self: super().ident or f"[no-id] {self.filename}") + name = property(lambda self: super().name or f"[unnamed] {self.ident}") + + @property + def menu(self): + menu = self.xml.find_one("effect/effects-menu") + if menu is not None and menu.get("hidden", "false") == "true": + return ["_hidden", self.name] + return super().menu diff --git a/share/extensions/other/inkman/manage_extensions.inx b/share/extensions/other/inkman/manage_extensions.inx new file mode 100644 index 0000000..dc2b01f --- /dev/null +++ b/share/extensions/other/inkman/manage_extensions.inx @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <name>Manage Extensions...</name> + <id>org.inkscape.extension.manager</id> + <effect needs-document="false" refresh-extensions="true" implements-custom-gui="true"> + <object-type>all</object-type> + <effects-menu hidden="true"/> + </effect> + <script> + <command location="inx" interpreter="python">manage_extensions.py</command> + </script> +</inkscape-extension> 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:]) diff --git a/share/extensions/other/inkman/pyproject.toml b/share/extensions/other/inkman/pyproject.toml new file mode 100644 index 0000000..d2a4fbf --- /dev/null +++ b/share/extensions/other/inkman/pyproject.toml @@ -0,0 +1,19 @@ +[tool.poetry] +name = "inkman" +version = "1.0.0" +description = "A GTK3 based extension manager for Inkscape." +authors = ["Martin Owens <doctormo@geek-2.com>"] +maintainers = ["Martin Owens <doctormo@geek-2.com>"] +license = "GPL-3.0-or-later" + +# The dependencies below are NOT used for packaging, they are abstract. +# They are merely for packagers' convenience and are used in CI for extensions. +[tool.poetry.dependencies] +python = ">=3.7" +appdirs = "1.4.4" +requests = "*" +CacheControl = {extras = ["filecache"], version = "*"} + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" |