pax_global_header00006660000000000000000000000064135216065370014522gustar00rootroot0000000000000052 comment=47f62b1d6ceed1eeb58eeddaf2975a5910645a8b .coveragerc000066400000000000000000000000331352160653700132030ustar00rootroot00000000000000[run] omit = */__init__.py .editorconfig000066400000000000000000000005641352160653700135500ustar00rootroot00000000000000# this should work for all editors that support .editorconfig! # # on debian, emacs users should install elpa-editorconfig and vim # users should install vim-editorconfig. root = true [*] indent_style = space insert_final_newline = true trim_trailing_whitespace = true end_of_line = lf charset = utf-8 indent_size = 4 max_line_length = 70 [Makefile] indent_style = tab .gitignore000066400000000000000000000001621352160653700130550ustar00rootroot00000000000000.cache *~ *.pyc .*swp *.egg-info deb_dist dist build/ *__pycache__ .tox output/ .coverage .pytest_cache/ htmlcov/ .readthedocs.yml000066400000000000000000000007771352160653700141670ustar00rootroot00000000000000version: 2 build: image: latest sphinx: # Ignores it, apprently # configuration: docs/source/conf_rtfd.py configuration: docs/source/conf.py builder: html formats: [epub] python: version: 3.7 install: - requirements: docs/requirements.txt # This is not used to don't depend on python3-gpg that depends on libgpgme-dev # and it's not installed in rtfd. # # To run "pip install ." in rtfd.io # pip_install: true # # To run "pip install .[doc]" in rtfd.io # extra_requirements: # - doc .travis.yml000066400000000000000000000007551352160653700132060ustar00rootroot00000000000000sudo: required dist: bionic language: python python: - '3.6' - "3.7" - "3.8-dev" # - "nightly" # - "pypy3.5" install: pip install tox-travis script: - tox # This is not in included in the tox envlist, in order to don't need Internet # when running tox # - tox -e doclinks - tox -e clean before_install: - gpg --version - sudo apt update && sudo apt install -y libgpgme-dev swig # This is not installed before # addons: # apt: # packages: # - libgpgme-dev CHANGELOG.rst000066400000000000000000000017531352160653700131150ustar00rootroot00000000000000Changelog ========= 0.3.0 (2019-08-04) ------------------ Changes ~~~~~~~ - Docs: links depend on from where docs are read - CI: Pass the tests - Make rtfd be able to build documentation - Docs: Reorganize/rename submodules API 0.2.0 (2019-04-04) ------------------ New ~~~ - Docs: Show global TOC and page source link. - Docs: show source code link. - Tests: Add validate_args test. Changes ~~~~~~~ - Gpg_utils:simplify logic and logs - CI: test python 3.7, upgrade to xenial - Docs: Generate man with sphinx. - Update copyright year. - Gpg_utils: simplify logic and logs. - Opgpcard: !refactor Add validate_args function - Cli: Change args order, remove empty help. - Cli: Add module doc, argparser description. - Cli: Move to a function args parser initialization. Fix ~~~ - README: Remove paragraph that is no longer true. 0.1.4 (2018-05-19) ------------------ - Include package data. - Clean files included in distribution. - Add man. - Update copyright year. - Fix tox, travis, clean up. LICENSE000066400000000000000000001045061352160653700121010ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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 . 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: {project} Copyright (C) {year} {fullname} 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 . 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 . MANIFEST.in000066400000000000000000000004561352160653700126310ustar00rootroot00000000000000include *.rst include .editorconfig include LICENSE include *.txt include tox.ini recursive-include docs * recursive-include opgpcard *.svg recursive-include opgpcard *.vcf recursive-include tests * recursive-include examples *.svg recursive-include examples *.vcf prune */__pycache__ prune docs/build README.rst000066400000000000000000000047451352160653700125670ustar00rootroot00000000000000opgpcard - OpenPGP Card ======================= .. .. image:: https://badge.fury.io/py/opgpcard.svg .. :target: https://badge.fury.io/py/opgpcard .. :alt: Latest stable version .. currently not working .. .. image:: https://travis-ci.org/juga0/opgpcard.svg?branch=master .. :target: https://travis-ci.org/juga0/opgpcard?branch=master .. :alt: Travis-CI Create a VCard, a QR code and/or a printable business cards including OpenPGP key and fingerprint. ``opgpcard`` is a tool to create a VCard [0] including OpenPGP [1] key and fingerprint, a QR code [2] of the VCard, a SVG [3] image formatted as a "business" card [4] to print including the QR code and or a batch of 10 those "business" cards to print in DIN4. The idea comes from the Debian pgp-tools [5] ``gpg-key2ps`` script, which *output a PostScript file which has your Key-ID, UIDs and fingerprint nicely formatted for printing paper slips to take with you to a signing-party.* However the slips do not have the format of a standard "business" card and they tend to be lost. Sadly, most of the Address book [5] applications out there, do not implement the VCard properties [6] for OpenPGP, so when the QR code in these cards is scanned, the Address book application will import the mail address, but probably will ignore the OpenPGP key and/or fingerprint. [0] https://en.wikipedia.org/wiki/VCard [1] https://en.wikipedia.org/wiki/QR_code [2] https://en.wikipedia.org/wiki/Pretty_Good_Privacy#OpenPGP [3] https://en.wikipedia.org/wiki/SVG [5] https://pgp-tools.alioth.debian.org/ [4] https://en.wikipedia.org/wiki/Business_card [5] https://en.wikipedia.org/wiki/Address_book#Software_address_book [6] https://en.wikipedia.org/wiki/VCard#Properties Installation ------------ See ``_ (in the local directory or GitHub) or ``_ . Download -------- You can download this project in either `zip `__ or `tar `__ formats. You can also clone the project with Git by running:: git clone https://github.com/juga0/opgpcard Bugs and features ----------------- To report a bug or a feature request, please fill in an issue on the `opgpcard issue tracker `__. License ------- ``opgpcard`` is Copyright 2016, 2017, 2018 by juga (juga at riseup dot net) under the terms of the `GPLv3 `__ license. docs/000077500000000000000000000000001352160653700120165ustar00rootroot00000000000000docs/Makefile000066400000000000000000000011411352160653700134530ustar00rootroot00000000000000# Minimal makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build SPHINXPROJ = opgpcard SOURCEDIR = source BUILDDIR = build # Put it first so that "make" without argument is like "make help". help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) .PHONY: help Makefile # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)docs/build/000077500000000000000000000000001352160653700131155ustar00rootroot00000000000000docs/build/html/000077500000000000000000000000001352160653700140615ustar00rootroot00000000000000docs/build/html/_images/000077500000000000000000000000001352160653700154655ustar00rootroot00000000000000docs/build/html/_images/opgpcard_juga.svg000066400000000000000000003023641352160653700210230ustar00rootroot00000000000000 OpenPGP card image/svg+xml OpenPGP card 31.12.2016 ju xor (ju at riseup dot net) OpenPGP GnuPG GPG VCard QRcode business card card juga juga@riseup.net 2DA8 1D01 455C 3A00 3219 8850 F305 447A F806 D46B OpenPGP fingerprint: (only local sign) docs/build/html/_images/opgpcard_juga_DIN4_10.svg000066400000000000000000003110551352160653700220760ustar00rootroot00000000000000 image/svg+xml juga juga@riseup.net 2DA8 1D01 455C 3A00 3219 8850 F305 447A F806 D46B OpenPGP fingerprint: (only local sign) docs/build/html/_images/opgpcard_qr_juga.svg000066400000000000000000002653541352160653700215340ustar00rootroot00000000000000 docs/make.bat000066400000000000000000000014601352160653700134240ustar00rootroot00000000000000@ECHO OFF pushd %~dp0 REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set SOURCEDIR=source set BUILDDIR=build set SPHINXPROJ=opgpcard if "%1" == "" goto help %SPHINXBUILD% >NUL 2>NUL if errorlevel 9009 ( echo. echo.The 'sphinx-build' command was not found. Make sure you have Sphinx echo.installed, then set the SPHINXBUILD environment variable to point echo.to the full path of the 'sphinx-build' executable. Alternatively you echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from echo.http://sphinx-doc.org/ exit /b 1 ) %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% goto end :help %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% :end popd docs/requirements.txt000066400000000000000000000000261352160653700153000ustar00rootroot00000000000000lxml>=4.1 qrcode>=5.3 docs/source/000077500000000000000000000000001352160653700133165ustar00rootroot00000000000000docs/source/README.rst000077700000000000000000000000001352160653700171152../../README.rstustar00rootroot00000000000000docs/source/conf.py000066400000000000000000000134371352160653700146250ustar00rootroot00000000000000#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # opgpcard documentation build configuration file, created by # sphinx-quickstart on Sun Dec 17 14:46:14 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # # import os # import sys # sys.path.insert(0, os.path.abspath('.')) # from opgpcard import __version__, __author__, __copyright__ # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ # 'sphinx.ext.autodoc', # 'sphinx.ext.doctest', 'sphinx.ext.todo', # 'sphinx.ext.coverage', 'sphinx.ext.githubpages', # 'sphinx.ext.viewcode' ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The master toctree document. master_doc = 'index' # General information about the project. project = 'opgpcard' copyright = 'juga at riseup dot net' author = copyright # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # # The short X.Y version. # version = __version__ # # The full version, including alpha/beta/rc tags. # release = __version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = [] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = True # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'alabaster' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # html_theme_options = { # 'logo': 'logo.png', 'github_user': 'juga0', 'github_repo': 'opgpcard', } # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # Custom sidebar templates, must be a dictionary that maps document names # to template names. # # This is required for the alabaster theme # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars html_sidebars = { '**': [ 'relations.html', # needs 'show_related': True theme option to display 'searchbox.html', 'globaltoc.html', 'sourcelink.html', ] } # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. htmlhelp_basename = 'opgpcarddoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # # 'preamble': '', # Latex figure (float) alignment # # 'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). # latex_documents = [ # (master_doc, 'opgpcard.tex', 'opgpcard Documentation', # author, 'manual'), # ] # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('man_opgpcard', 'opgpcard', 'OpenPGP printable card', [author], 1), ] # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) # texinfo_documents = [ # (master_doc, 'opgpcard', 'opgpcard Documentation', # author, 'opgpcard', 'One line description of project.', # 'Miscellaneous'), # ] # -- Options for Epub output ---------------------------------------------- # Bibliographic Dublin Core info. epub_title = project epub_author = author epub_publisher = author epub_copyright = copyright # The unique identifier of the text. This can be a ISBN number # or the project homepage. # # epub_identifier = '' # A unique identification for the text. # # epub_uid = '' # A list of files that should not be packed into the epub file. epub_exclude_files = ['search.html'] docs/source/examples.rst000066400000000000000000000004601352160653700156660ustar00rootroot00000000000000Output examples ==================== VCard file ----------- .. include:: ./images/opgpcard_juga.vcf QR code -------- .. image:: ./images/opgpcard_qr_juga.* Card ----- .. image:: ./images/opgpcard_juga.* Batch 10 cards to print ------------------------ .. image:: ./images/opgpcard_juga_DIN4_10.* docs/source/images/000077500000000000000000000000001352160653700145635ustar00rootroot00000000000000docs/source/images/opgpcard_juga.svg000077700000000000000000000000001352160653700261112../../../examples/opgpcard_juga.svgustar00rootroot00000000000000docs/source/images/opgpcard_juga.vcf000077700000000000000000000000001352160653700260472../../../examples/opgpcard_juga.vcfustar00rootroot00000000000000docs/source/images/opgpcard_juga_DIN4_10.svg000077700000000000000000000000001352160653700302452../../../examples/opgpcard_juga_DIN4_10.svgustar00rootroot00000000000000docs/source/images/opgpcard_qr_juga.svg000077700000000000000000000000001352160653700273152../../../examples/opgpcard_qr_juga.svgustar00rootroot00000000000000docs/source/index.rst000066400000000000000000000010041352160653700151520ustar00rootroot00000000000000.. opgpcard documentation master file, created by sphinx-quickstart on Sun Dec 17 14:46:14 2017. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Welcome to opgpcard's documentation! ==================================== .. toctree:: :maxdepth: 2 :caption: Contents: README install run man_opgpcard examples vcftools todo Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` docs/source/install.rst000066400000000000000000000021151352160653700155150ustar00rootroot00000000000000 Installation ============= The recommended method is to install it from your system distribution. In Debian/Ubuntu systems:: sudo apt install opgpcard Installation for developers --------------------------- System requirements ~~~~~~~~~~~~~~~~~~~ - Python 3 (>= 3.5) - GPGME_ - SWIG_ (to build GPGME_) - virtualenv_ (it is recommended to install the required python dependencies in a virtualenv) In Debian:: sudo apt install python3 swig libgpgme-dev virtualenv Python dependencies ~~~~~~~~~~~~~~~~~~~ - qrcode_ - lxml_ - gpg_ To install the Python dependencies, create a ``virtualenv`` first :: virtualenv venv -p /usr/bin/python3 source venv/bin/activate Clone ``opgpcard``:: git clone https://github.com/juga0/opgpcard.git Install the python dependencies:: cd opgpcard && pip install . .. _SWIG: http://swig.org/ .. _GPGME: https://www.gnupg.org/related_software/gpgme/ .. _virtualenv: https://virtualenv.pypa.io/en/stable/installation/ .. _qrcode: https://pypi.python.org/pypi/qrcode/ .. _lxml: https://lxml.de/ .. _gpg: https://pypi.org/project/gpg/ docs/source/man_opgpcard.rst000066400000000000000000000024351352160653700165060ustar00rootroot00000000000000OpenPGP printable card - opgpcard(1) ==================================== SYNOPSIS -------- usage: opgpcard [-h] [-d] [-v] [-f FIRSTNAME] [-l LASTNAME] [-m MAIL] [-p FINGERPRINT] [-s] [-o OUTPUTDIR] DESCRIPTION ------------ Create a VCard, a QR code and/or a printable business cards including OpenPGP key and fingerprint. OPTIONS --------- If --fingerprint, --mail AND either --firstname or --lastname are provided, a card is generated with those arguments. If --fingerprint, --mail, --firstname OR --lastname are provided, it will search for keys matching those arguments in that order, and use the data from the first key and UID found. If no arguments are provided, it will search for private keys and use the data from the first key and UID found. It will exit with error in any other case. Optional arguments ~~~~~~~~~~~~~~~~~~ -h, --help Show help message and exit. --version Show this program version and exit --debug Set logging level to debug (default: False) -f FIRSTNAME, --firstname FIRSTNAME -l LASTNAME, --lastname LASTNAME -m MAIL, --mail MAIL -p FINGERPRINT, --fingerprint FINGERPRINT -s, --localsign (default: True) -o OUTPUTDIR, --outputdir OUTPUTDIR (default: output/) BUGS ---- Please report bugs at https://github.com/juga0/opgpgcard. docs/source/run.rst000066400000000000000000000005061352160653700146550ustar00rootroot00000000000000Running opgpcard ================= To know which arguments you can run ``opgpcard`` with, run:: opgpcard -h Or see the manual page: - ``man opgpcard`` (if installed via Debian package) - ``man docs/source/man_opgpcard.rst`` (in the local respository) - ``_ docs/source/todo.rst000066400000000000000000000001761352160653700150210ustar00rootroot00000000000000TODO ===== [ ] Include OpenPGP public key encoded in base 64 in the the .vcf:: KEY;PGP;ENCODING=BASE64:%(b64pubkey)s docs/source/vcftools.rst000066400000000000000000000002551352160653700157110ustar00rootroot00000000000000Adress book applications that support OpenPGP properties when importing vcard_utils =================================================================================== TBD examples/000077500000000000000000000000001352160653700127045ustar00rootroot00000000000000examples/opgpcard_juga.svg000066400000000000000000003023641352160653700162420ustar00rootroot00000000000000 OpenPGP card image/svg+xml OpenPGP card 31.12.2016 ju xor (ju at riseup dot net) OpenPGP GnuPG GPG VCard QRcode business card card juga juga@riseup.net 2DA8 1D01 455C 3A00 3219 8850 F305 447A F806 D46B OpenPGP fingerprint: (only local sign) examples/opgpcard_juga.vcf000066400000000000000000000005441352160653700162140ustar00rootroot00000000000000begin:vcard fn:juga n:juga email;internet:juga@riseup.net key;pgp;http://pool.sks-keyservers.net:11371/pks/lookup?op=get&search=juga@riseup.net OPENPGP4FPR:2DA81D01455C3A0032198850F305447AF806D46B X-KADDRESSBOOK-OPENPGPFP:2DA81D01455C3A0032198850F305447AF806D46B NOTE:vCard generate with opgpcard (https://github.com/juga0/opgpcard) version:2.1 end:vcard examples/opgpcard_juga_DIN4_10.svg000066400000000000000000003110551352160653700173150ustar00rootroot00000000000000 image/svg+xml juga juga@riseup.net 2DA8 1D01 455C 3A00 3219 8850 F305 447A F806 D46B OpenPGP fingerprint: (only local sign) examples/opgpcard_qr_juga.svg000066400000000000000000002653541352160653700167530ustar00rootroot00000000000000 opgpcard/000077500000000000000000000000001352160653700126655ustar00rootroot00000000000000opgpcard/__init__.py000066400000000000000000000043171352160653700150030ustar00rootroot00000000000000# -*- coding: utf-8 -*- # vim:ts=4:sw=4:expandtab # Copyright 2016-2019 juga # This file is part of opgpcard. # # opgpcard 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. # # opgpcard 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 opgpcard. If not, see . try: from _version import version except ImportError: try: from setuptools_scm import get_version version = get_version() except (ImportError, LookupError): version = '0.3.0' __version__ = version __author__ = "juga" __author_mail__ = "juga@riseup.net" __description__ = "Create a VCard, a QR code and/or a printable " \ "business cards including OpenPGP key and fingerprint." __long_description__ = """opgpcard is a tool to create a VCard including OpenPGP key and fingerprint, a QR code of the VCard, a SVG image formatted as a business card to print including the QR code and or a batch of 10 those business cards to print in DIN4.""" __website__ = 'https://github.com/juga0/opgpcard' __documentation__ = 'http://opgpcard.readthedocs.io/en/' + __version__ __copyright__ = """Copyright (C) 2016-2019 juga .""" __license__ = """ This package 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 any later version. This package 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 package. If not, see . """ opgpcard/cli.py000066400000000000000000000065361352160653700140200ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- # vim:ts=4:sw=4:expandtab 2 # Copyright 2016-2019 juga # This file is part of opgpcard. # # opgpcard 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. # # opgpcard 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 opgpcard. If not, see . """Create a VCard, a QR code and/or a printable business cards including OpenPGP key and fingerprint. If --fingerprint, --mail AND either --firstname or --lastname are provided, a card is generated with those arguments. If --fingerprint, --mail, --firstname OR --lastname are provided, it will search for keys matching those arguments in that order, and use the data from the first key and UID found. If no arguments are provided, it will search for private keys and use the data from the first key and UID found. It will exit with error in any other case. """ import argparse import logging from . import __version__ from .conf import OUTPUT_DIR from .opgpcard import gen_opgpcard class RawTextArgumentDefaultsHelpFormatter( argparse.RawTextHelpFormatter, argparse.ArgumentDefaultsHelpFormatter ): pass def create_args_parser(): parser = argparse.ArgumentParser( description=__doc__, formatter_class=RawTextArgumentDefaultsHelpFormatter ) parser.add_argument('-d', '--debug', help='Set logging level to debug', action='store_true') parser.add_argument('-v', '--version', action='version', help='Show this program version and exit', version='%(prog)s ' + __version__) parser.add_argument('-f', '--firstname', default='') parser.add_argument('-l', '--lastname', default='') parser.add_argument('-m', '--mail') parser.add_argument('-p', '--fingerprint') parser.add_argument('-s', '--localsign', action='store_true', default=True) parser.add_argument('-o', '--outputdir', default=OUTPUT_DIR) return parser def main(): parser = create_args_parser() args = parser.parse_args() if args.debug: FORMAT = "%(levelname)s: %(filename)s:%(lineno)s -"\ "%(funcName)s - %(message)s" logging.basicConfig(format=FORMAT, level=logging.DEBUG) logger = logging.getLogger(__name__) else: from logging import handlers FORMAT = "%(asctime)s %(name)s %(module)s[%(process)s]:"\ " %(levelname)s - %(message)s" datefmt = "%b %d %H:%M:%S" logging.basicConfig(format=FORMAT, level=logging.INFO, datefmt=datefmt) logger = logging.getLogger(__name__) h = handlers.SysLogHandler(address='/dev/log') formatter = logging.Formatter(FORMAT) h.setFormatter = formatter logger.addHandler(h) logger.debug('args %s', args) gen_opgpcard(args) if __name__ == '__main__': main() opgpcard/conf.py000066400000000000000000000040271352160653700141670ustar00rootroot00000000000000# -*- coding: utf-8 -*- # vim:ts=4:sw=4:expandtab 2 # Copyright 2016-2019 juga # This file is part of opgpcard. # # opgpcard 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. # # opgpcard 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 opgpcard. If not, see . """opgpcard configuration.""" import os.path SVG_NAMESPACE = "http://www.w3.org/2000/svg" XPATH_FP = "//svg:tspan[@id='openpgp_fp']" XPATH_LSIGN = "//svg:tspan[@id='only_lsign_text']" XPATH_MAIL = "//svg:tspan[@id='mail_address']" XPATH_FNAME = "//svg:tspan[@id='firstname']" XPATH_LNAME = "//svg:tspan[@id='lastname']" XPATH_QRCODE = "//svg:path[@id='qr-path']" XPATH_CARD_QRCODE = "//svg:g[@id='QRcode']" XPATH_CARD_SQUARE = "//svg:rect[@id='rect13153']" DATA_DIR = 'data' TEMPLATE_FILE = 'opgpcard_template.svg' VCARD_TEMPLATE_FILE = 'opgpcard_template.vcf' OUTPUT_DIR = 'output' CARD_NAME = 'opgpcard_%s.svg' CARD_NAME_NO_QRCODE = 'opgpcard_noqr_%s.svg' VCARD_NAME = 'opgpcard_%s.vcf' QRCODE_NAME = 'opgpcard_qr_%s' QRCODE_NAME_RESIZED = 'opgpcard_qr_resized_%s' SVG_EXT = '.svg' TEMPLATE_10_FILE = 'opgpcard_template_DIN4_10.svg' CARD_10_NAME = 'opgpcard_%s_DIN4_10.svg' CARD_10_NAME_NO_QRCODE = 'opgpcard_noqr_%s_DIN4_10.svg' BASE_PATH = os.path.abspath(os.path.dirname(__file__)) ROOT_PATH, _ = os.path.split(os.path.realpath(BASE_PATH)) OUTPUT_PATH = os.path.join(ROOT_PATH, OUTPUT_DIR) TEMPLATE_PATH = os.path.join(BASE_PATH, DATA_DIR, TEMPLATE_FILE) VCARD_TEMPLATE_PATH = os.path.join(BASE_PATH, DATA_DIR, VCARD_TEMPLATE_FILE) TEMPLATE_10_PATH = os.path.join(BASE_PATH, DATA_DIR, TEMPLATE_10_FILE) opgpcard/data/000077500000000000000000000000001352160653700135765ustar00rootroot00000000000000opgpcard/data/opgpcard_template.svg000066400000000000000000000170711352160653700200170ustar00rootroot00000000000000 OpenPGP card image/svg+xml OpenPGP card 31.12.2016 ju xor (ju at riseup dot net) OpenPGP GnuPG GPG VCard QRcode business card card firstname lastname mail_address@example.com XXXX_XXXX_XXXX_XXXX_XXXX_XXXX_XXXX_XXXX_XXXX OpenPGP fingerprint: (only local sign) opgpcard/data/opgpcard_template.vcf000066400000000000000000000004531352160653700177720ustar00rootroot00000000000000begin:vcard fn:%(fname)s %(lname)s n:%(fname)s email;internet:%(mail)s key;pgp;http://pool.sks-keyservers.net:11371/pks/lookup?op=get&search=%(mail)s OPENPGP4FPR:%(fp)s X-KADDRESSBOOK-OPENPGPFP:%(fp)s NOTE:vCard generate with opgpcard (https://github.com/juga0/opgpcard) version:2.1 end:vcard opgpcard/data/opgpcard_template_DIN4_10.svg000066400000000000000000000313201352160653700210660ustar00rootroot00000000000000 image/svg+xml firstname lastname mail_address@example.com XXXX_XXXX_XXXX_XXXX_XXXX_XXXX_XXXX_XXXX_XXXX OpenPGP fingerprint: (only local sign) opgpcard/gpg_utils.py000066400000000000000000000044131352160653700152360ustar00rootroot00000000000000# vim:ts=4:sw=4:expandtab 2 # Copyright 2016-2019 juga # This file is part of opgpcard. # # opgpcard 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. # # opgpcard 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 opgpcard. If not, see . """opgpcard GPG utils""" import logging import gpg logger = logging.getLogger(__name__) __all__ = ['obtain_key_attrs_from_key', 'obtain_skeys', 'obtain_key_from_email', 'obtain_key_attrs_from_email'] def obtain_key_attrs_from_key(key): # TODO: select which UIDs to include # TODO: obtain public key data name = key.uids[0].name email = key.uids[0].email if not name: name = email.split('@')[0] namesplitted = name.split() fname, lname = namesplitted[0], ' '.join(namesplitted[1:]) fp = key.fpr key_attrs = {'mail': email, 'fingerprint': fp, 'fname': fname, 'lname': lname} logger.info('Using attributes from the first UID %s.', key_attrs) return key_attrs def obtain_skeys(): c = gpg.Context() skeys = list(c.keylist(secret=True)) if skeys: logger.info('Found private keys in your keyring.') return skeys def obtain_key_from_email(attr): # TODO: select key if there're several for the same email. c = gpg.Context() keys = list(c.keylist(attr)) if not keys: return None logger.info('Using the first key found matching %s.', attr) key = keys[0] return key def obtain_key_attrs_from_email(attr): key = obtain_key_from_email(attr) if key: attrs = obtain_key_attrs_from_key(key) return attrs return None def obtain_key_attrs(): skeys = obtain_skeys() if skeys: logger.info("Using the first key found.") attrs = obtain_key_attrs_from_key(skeys[0]) return attrs return None opgpcard/opgpcard.py000066400000000000000000000173311352160653700150430ustar00rootroot00000000000000# -*- coding: utf-8 -*- # vim:ts=4:sw=4:expandtab 2 # Copyright 2016-2019 juga # This file is part of opgpcard. # # opgpcard 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. # # opgpcard 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 opgpcard. If not, see . """opgpcard main functions""" import logging import os import os.path import sys from lxml import etree from .conf import (SVG_NAMESPACE, TEMPLATE_10_PATH, XPATH_CARD_SQUARE, XPATH_QRCODE, CARD_10_NAME, XPATH_CARD_QRCODE, TEMPLATE_PATH, CARD_NAME, VCARD_NAME, QRCODE_NAME, SVG_EXT, CARD_NAME_NO_QRCODE, CARD_10_NAME_NO_QRCODE) from . import vcard_utils from . import qrsvg from . import gpg_utils logger = logging.getLogger(__name__) __all__ = ['fp_no_spaces', 'fp_spaces', 'extract_card_qr_coord', 'gen_base_card_tree', 'include_qr_elem_path_in_card', 'gen_opgpcard'] def fp_no_spaces(fp): fpnospaces = ''.join(fp.split()) return fpnospaces def fp_spaces(fp): fpnospaces = fp_no_spaces(fp) fpspaces = ' '.join([fpnospaces[i:i+4] for i in range(0, len(fpnospaces), 4)]) return fpspaces def extract_card_qr_coord(xpath_square, template_path=TEMPLATE_PATH): tree = etree.parse(template_path) elements = tree.xpath(xpath_square, namespaces={'svg': SVG_NAMESPACE}) if elements: e = elements[0] keys = ['x', 'y', 'height', 'width'] attrs = {x: e.get(x) for x in keys} logger.debug('Card qr square attrs %s', attrs) return attrs return None def gen_base_card_tree(xpath_text_dict, card_path, template_path=TEMPLATE_PATH): tree = etree.parse(template_path) for xpath, text in list(xpath_text_dict.items()): elements = tree.xpath(xpath, namespaces={'svg': SVG_NAMESPACE}) if elements: elements[0].text = text logger.debug('Added text %s to card', text) tree.write(card_path) logger.info('Generated base card in %s', card_path) return tree def include_qr_elem_path_in_card(card_path, card_tree, qr_svg_path): elements = card_tree.xpath(XPATH_CARD_QRCODE, namespaces={'svg': SVG_NAMESPACE}) if elements: logger.debug('Appending QRcode to the card.') e = elements[0] e.append(qr_svg_path) else: logger.warning('No elements found to apend the QRcode') card_tree.write(card_path) # logger.debug('Card tree with QR: %s', etree.tostring(card_tree)) logger.info('QR Code included in card %s', card_path) return card_tree def validate_args(args): # if all needed arguments are provided, return them if args.fingerprint and args.mail and (args.firstname or args.lastname): return args # if any argument is provided, search keys with that attribute # in this order. attrs = args.fingerprint or args.mail or args.firstname or args.lastname if attrs: logger.debug('Obtaining key containing %s', attrs) a = gpg_utils.obtain_key_attrs_from_email(attrs) if a: args.fingerprint = a['fingerprint'] args.mail = a['mail'] # Use args if provided, otherwise use key attrs args.firstname = args.firstname or a['fname'] args.lastname = args.lastname or a['lname'] return args logger.info("No key found matching %s.", attrs) return None # if no argument is provided, search keys and if non found, exit if not (args.mail and args.fingerprint and (args.firstname or args.lastname)): logger.info('No arguments provided, searching for keys.') a = gpg_utils.obtain_key_attrs() if a: args.mail = a['mail'] args.fingerprint = a['fingerprint'] args.firstname = a['fname'] args.lastname = a['lname'] return args # No arg provided, and no key found, exit logger.info("No keys found.") return None return None def gen_opgpcard(args): args = validate_args(args) if not args: logger.info("Can not create card. Please provide more arguments.") sys.exit(1) # initialize file paths output_path = args.outputdir if not os.path.isdir(output_path): os.makedirs(output_path) # file paths vcard_path = os.path.join(output_path, VCARD_NAME % (args.firstname + args.lastname,)) qr_path = os.path.join(output_path, QRCODE_NAME % (args.firstname + args.lastname,)) + SVG_EXT card_path_no_qrcode = os.path.join(output_path, CARD_NAME_NO_QRCODE % (args.firstname + args.lastname,)) card_path = os.path.join(output_path, CARD_NAME % (args.firstname + args.lastname,)) card_10_path_no_qrcode = os.path.join(output_path, CARD_10_NAME_NO_QRCODE % (args.firstname + args.lastname,)) card_10_path = os.path.join(output_path, CARD_10_NAME % (args.firstname + args.lastname,)) # generate vcard fpnospaces = fp_no_spaces(args.fingerprint) vcard_dict = vcard_utils.gen_vcard_attrs_dict(args.firstname, args.lastname, args.mail, fpnospaces) vcard = vcard_utils.gen_vcard(vcard_dict, vcard_path) # generate card text fpspaces = fp_spaces(args.fingerprint) text_xpath = vcard_utils.gen_text_xpath_dict(args.firstname, args.lastname, args.mail, fpspaces, args.localsign) # card svg card_tree = gen_base_card_tree(text_xpath, card_path_no_qrcode, TEMPLATE_PATH) square_attrs = extract_card_qr_coord(XPATH_CARD_SQUARE, TEMPLATE_PATH) # qrcode svg qrsvg.gen_qr_svgimage(vcard, qr_path) qr_svg_path = qrsvg.extract_qr_elem_path(qr_path, XPATH_QRCODE) qr_svg_width = qrsvg.obtain_qr_svg_width(qr_path) qr_elem_path_transformed = qrsvg.add_transform_attr_qr_elem_path( square_attrs, qr_svg_path, qr_svg_width ) include_qr_elem_path_in_card(card_path, card_tree, qr_elem_path_transformed) # 10 DINA4 card_10_tree = gen_base_card_tree(text_xpath, card_10_path_no_qrcode, TEMPLATE_10_PATH) include_qr_elem_path_in_card(card_10_path, card_10_tree, qr_elem_path_transformed) opgpcard/qrsvg.py000066400000000000000000000060241352160653700144030ustar00rootroot00000000000000# -*- coding: utf-8 -*- # vim:ts=4:sw=4:expandtab 2 # Copyright 2016-2019 juga # This file is part of opgpcard. # # opgpcard 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. # # opgpcard 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 opgpcard. If not, see . """opgpcard functions to generate QR code.""" import logging from lxml import etree from qrcode.main import QRCode from qrcode.image.svg import SvgPathImage from . import conf logger = logging.getLogger(__name__) __all__ = ['gen_qr_svgimage', 'extract_qr_elem_path', 'obtain_qr_svg_width', 'add_transform_attr_qr_elem_path'] def gen_qr_svgimage(vcard, qr_path): qr = QRCode(image_factory=SvgPathImage) qr.add_data(vcard) # img = qr.make_image(image_factory=SvgPathImage) img = qr.make_image(fit=True) # NOTE: img.get_image() will return a lxml svg element, # but without the qr path element. # Probably there is other way to obtain it other than having to save # the image # img.save(six.BytesIO()) img.save(qr_path) logger.info('QRCode generated in %s, width: %s', qr_path, img.width) return img, img.width def extract_qr_elem_path(qr_path, qr_svg_path_xpath): tree = etree.parse(qr_path) elements = tree.xpath(qr_svg_path_xpath, namespaces={'svg': conf.SVG_NAMESPACE}) if elements: e = elements[0] logger.debug('Extracted QR element path %s.', e) return e return None def obtain_qr_svg_width(qr_path): tree = etree.parse(qr_path) root = tree.getroot() qr_svg_width = float(root.get('width').strip('mm')) logger.debug('QR Code element width %s', qr_svg_width) return qr_svg_width def add_transform_attr_qr_elem_path(square_attrs, qr_svg_path, qr_svg_width): square_width = float(square_attrs['width'].strip('mm')) scale_factor = square_width/qr_svg_width # NOTE: if the element will be resized when it is already placed in the # card, it would be needed to calculate the new translate # coordinates, but as it has not been placed yet, the coordinates # are the same as for the square. # NOTE: the translate coordinates could be calculated as: # float(square_attrs['x']) - float(square_attrs['x']) * scale_factor qr_x = float(square_attrs['x']) qr_y = float(square_attrs['y']) transform_matrix = (scale_factor, 0, 0, scale_factor, qr_x, qr_y) qr_svg_path.set('transform', 'matrix%s' % str(transform_matrix)) logger.debug('QRCode transform matrix %s', transform_matrix) return qr_svg_path opgpcard/vcard_utils.py000066400000000000000000000037721352160653700155670ustar00rootroot00000000000000# -*- coding: utf-8 -*- # vim:ts=4:sw=4:expandtab 2 # Copyright 2016-2019 juga # This file is part of opgpcard. # # opgpcard 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. # # opgpcard 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 opgpcard. If not, see . """opgpcard functions to generate VCard""" import logging import io from . import conf logger = logging.getLogger(__name__) __all__ = ['gen_vcard_attrs_dict', 'gen_text_xpath_dict', 'gen_vcard'] def gen_vcard_attrs_dict(fname, lname, mail, fp): vcard_dict = {'fname': fname, 'lname': lname, 'mail': mail, 'fp': fp} logger.debug('vcard_dict %s.', vcard_dict) return vcard_dict def gen_text_xpath_dict(fname, lname, mail, fp, lsign=True): if lsign: lsign_text = '(only local sign)' else: lsign_text = '' xpath_text_dict = {conf.XPATH_FNAME: fname, conf.XPATH_LNAME: lname, conf.XPATH_MAIL: mail, conf.XPATH_FP: fp, conf.XPATH_LSIGN: lsign_text} logger.debug('xpath_text_dict %s.', xpath_text_dict) return xpath_text_dict def gen_vcard(vcard_dict, vcard_path, vcard_template_path=conf.VCARD_TEMPLATE_PATH): with io.open(vcard_template_path) as fp: vcard = fp.read() logger.debug('vcard template %s', vcard) vcard = vcard % vcard_dict logger.debug('vcard %s', vcard) with io.open(vcard_path, 'w') as fp: fp.write(vcard) logger.info('VCard generated in %s.', vcard_path) return vcard setup.py000066400000000000000000000042361352160653700126050ustar00rootroot00000000000000#!/usr/bin/env python # This file is part of opgpcard, a set of scripts to # use different tor guards depending on the network we connect to. # # Copyright (C) 2016-2019 juga (juga at riseup dot net) # # opgpcard is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 3 of the # License, or (at your option) any later version. # # opgpcard 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 opgpcard. If not, see . # from setuptools import setup, find_packages import opgpcard setup( name='opgpcard', version=opgpcard.__version__, description=opgpcard.__description__, long_description=opgpcard.__long_description__, author=opgpcard.__author__, author_email=opgpcard.__author_mail__, platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], license='GPLv3+', url=opgpcard.__website__, packages=find_packages(exclude=['contrib', 'docs', 'tests*']), install_requires=["qrcode", "lxml", "gpg"], extras_require={ # vulture: find unused code 'dev': ['flake8', 'vulture'], 'test': ['tox', 'pytest', 'coverage'], 'doc': ['sphinx', 'pylint'] }, tests_require=['pytest'], include_package_data=True, zip_safe=False, entry_points={ 'console_scripts': [ 'opgpcard = opgpcard.cli:main', ] }, classifiers=[ 'Development Status :: 4 - Beta', "Environment :: Console", 'Intended Audience :: End Users/Desktop', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU General Public License v3 ' + 'or later (GPLv3+)', 'Operating System :: OS Independent', 'Programming Language :: Python', "Topic :: Software Development :: Libraries :: Python Modules", ], keywords='python openpgp gpp businesscard vcard qrcode', ) tests/000077500000000000000000000000001352160653700122305ustar00rootroot00000000000000tests/conftest.py000066400000000000000000000005521352160653700144310ustar00rootroot00000000000000"""""" import pytest @pytest.fixture() def datadir(request): class D: def __init__(self, basepath): self.basepath = basepath def open(self, name): return self.basepath.join(name).open() def join(self, name): return self.basepath.join(name).strpath return D(request.fspath.dirpath("data")) tests/test_opgpcard.py000066400000000000000000000047711352160653700154510ustar00rootroot00000000000000"""Unit tests for opgpcard.cli""" from opgpcard.cli import create_args_parser from opgpcard.opgpcard import validate_args def test_validate_args(): """Test validate_args in cases that succed and fail. It does not test cases in which validate_args would succed because there are keys in the default keyring. """ parser = create_args_parser() args = parser.parse_args([]) # Cases that fail # This case might succeed if there'l a default keyring. # args = validate_args(args) # assert not args args = parser.parse_args(['-f', 'somefnamenotinlocalkeyring']) args = validate_args(args) assert not args args = parser.parse_args(['-l', 'somelnamenotinlocalkeyring']) args = validate_args(args) assert not args args = parser.parse_args(['-m', 'someemailnotinlocalkeyring']) args = validate_args(args) assert not args args = parser.parse_args(['-p', 'somefpnotinlocalkeyring']) args = validate_args(args) assert not args args = parser.parse_args(['-f', 'somefnamenotinlocalkeyring', '-m', 'someemailnotinlocalkeyring']) args = validate_args(args) assert not args args = parser.parse_args(['-f', 'somefnamenotinlocalkeyring', '-p', 'somefpnotinlocalkeyring']) args = validate_args(args) assert not args args = parser.parse_args(['-l', 'somelnamenotinlocalkeyring', '-m', 'someemailnotinlocalkeyring']) args = validate_args(args) assert not args args = parser.parse_args(['-l', 'somelnamenotinlocalkeyring', '-p', 'somefpnotinlocalkeyring']) args = validate_args(args) assert not args # Cases that succeed args = parser.parse_args(['-f', 'somefnamenotinlocalkeyring', '-m', 'someemailnotinlocalkeyring', '-p', 'somefpnotinlocalkeyring']) args = validate_args(args) assert args args = parser.parse_args(['-l', 'somelnamenotinlocalkeyring', '-m', 'someemailnotinlocalkeyring', '-p', 'somefpnotinlocalkeyring']) args = validate_args(args) assert args args = parser.parse_args(['-f', 'somefnamenotinlocalkeyring', '-l', 'somelnamenotinlocalkeyring', '-m', 'someemailnotinlocalkeyring', '-p', 'somefpnotinlocalkeyring']) args = validate_args(args) assert args tests/test_vcard_utils.py000066400000000000000000000007221352160653700161610ustar00rootroot00000000000000"""opgpcard tests.""" from opgpcard.vcard_utils import gen_vcard_attrs_dict def test_gen_vcard_attrs_dict(): fp = 'XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX' mail = 'other_example@othermail.com' fname = 'otherfname' lname = 'otherlname' xpath_text_dict = {'fp': fp, 'mail': mail, 'fname': fname, 'lname': lname} d = gen_vcard_attrs_dict(fname, lname, mail, fp) assert xpath_text_dict == d # TODO: more tests tox.ini000066400000000000000000000031461352160653700124050ustar00rootroot00000000000000[tox] envlist = inst,setup,py35,py36,py38-dev,lint,doc,stats skip_missing_interpreters = True [travis] python = 3.6: py36, inst, setup, unit, lint, doc 3.7: py37, inst, setup, unit, lint, doc 3.8: py38-dev, inst, setup, unit, lint, doc # test that it can be installed with custom commands and clean env [testenv:inst] skip_install = True commands = - pip install . ignore_errors = True recreate = True [testenv:setup] skip_install = True commands = python setup.py install recreate = True [testenv:unit] deps = .[test] commands = coverage run -a --rcfile={toxinidir}/.coveragerc --source=opgpcard -m pytest \ -s {toxinidir}/tests -vv [testenv:doc] deps = .[doc] whitelist_externals = make changedir = docs commands = make html make man # this requires Internet, it should not be in envlist [testenv:doclinks] deps = .[doc] whitelist_externals = make changedir = docs commands = make linkcheck [testenv:lint] skip_install = True deps = .[dev] # no restructuredtext_lint in ubuntu ; restructuredtext_lint # check-manifest commands = # check-manifest ; rst-lint README.rst CHANGELOG.rst ; flake8 --max-line-length 79 --exclude opgpcard/data, docs/source/conf.py flake8 opgpcard tests [testenv:stats] skip_install = True changedir={toxinidir} deps = .[test] # codecov commands= # nothing to combine while not using several python versions # coverage combine coverage report coverage html # only to run from travis # codecov # coveralls [testenv:clean] skip_install = True changedir={toxinidir} deps = coverage commands= coverage erase