diff options
Diffstat (limited to 'share/extensions/other/inkman')
33 files changed, 4631 insertions, 0 deletions
diff --git a/share/extensions/other/inkman/LICENSE.txt b/share/extensions/other/inkman/LICENSE.txt new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/share/extensions/other/inkman/LICENSE.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + 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/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. 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..7655213 --- /dev/null +++ b/share/extensions/other/inkman/inkman/remote.py @@ -0,0 +1,157 @@ +# +# 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: + try: + self.session.mount( + "https://", + CacheControlAdapter( + cache=FileCache(CACHE_DIR), + heuristic=ExpiresAfter(days=1), + ), + ) + except ImportError: + # This happens when python-lockfile is missing + pass + + 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..560764b --- /dev/null +++ b/share/extensions/other/inkman/pyproject.toml @@ -0,0 +1,20 @@ +[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 = "*" +filelock = "*" +CacheControl = {extras = ["filecache"], version = "*"} + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" |