Commit Graph

35 Commits

Author SHA1 Message Date
Justus Winter
c5d118b2a7 python: Raise exceptions on write errors.
* lang/python/pyme/core.py (Data.write): Handle errors.
* lang/python/pyme/errors.py (GPGMEError.fromSyserror): New function.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-12 18:01:24 +02:00
Justus Winter
f7094d8358 python: Fix writing to data buffers.
* lang/python/gpgme.i: Add typemap for buffers.
* lang/python/pyme/core.py (Data.write): Fix function.
* lang/python/tests/Makefile.am: Add new test.
* lang/python/tests/t-data.py: New file.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-12 17:59:21 +02:00
Justus Winter
e64bffe030 python: Add a test suite.
* configure.ac: Add new Makefile.
* lang/python/Makefile.am: Add subdirectory.
* lang/python/tests/Makefile.am: New file.
* lang/python/tests/t-wrapper.py: Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-12 15:37:00 +02:00
Justus Winter
ed0ce84fbd python: Cache generated wrapper functions.
* lang/python/util.py (GpgmeWrap.__getattr__): Cache generated wrapper
functions.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-12 14:57:42 +02:00
Justus Winter
e3d3d366bd python: Fix function invocation.
* lang/python/pyme/core.py (Data.new_from_fd): Fix function
invocation.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-12 12:59:05 +02:00
Justus Winter
af9371eb63 python: Fix name of exception, make slot methods explicit.
* lang/python/pyme/util.py (GpgmeWrapper._getctype): Fix exception,
add docstring.
(GpgmeWrapper._getnameprepend): New function.
(GpgmeWrapper._errorcheck): Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-12 12:59:05 +02:00
Justus Winter
ce5121ad53 python: Handle interpreter shutdown.
* lang/python/pyme/core.py: Avoid races at interpreter shutdown.  This
silences the most annoying occurrences, however this problem also
affects the SWIG generated code, which might indicate that the real
problem is somewhere else.  If so, this change can be easily reverted.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-12 11:53:43 +02:00
Justus Winter
c89d3a71ad python: Make test case more robust.
* lang/python/examples/t-edit.py: Check if key is found.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-12 11:51:21 +02:00
Justus Winter
d60deb8a12 python: Fix type translation.
* lang/python/gpgme.i: Adjust to Python3's string type being
'Unicode', not 'bytes'.  Fix type checking.
* lang/python/core.py (Data.write): Add docstring mentioning the
expected type of parameter 'buffer'.
(Data.read): Adjust read loop.  Also, use a saner chunk size, and join
all chunks at the end instead of adding them.
* lang/python/examples/simple.py: Adjust example.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-12 11:49:17 +02:00
Justus Winter
bbeee5e1a0 python: Fix simple example.
* lang/python/examples/simple.py: Flush stdout, encode name as
UTF-8 before passing it to GPGME.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-11 13:51:40 +02:00
Justus Winter
a29babd07c python: Integrate into the build system.
* configure.ac: Make Python bindings configurable, add new Makefile.
* lang/python/Makefile.am: New file.
* lang/python/setup.py: Integrate into the build system.
* m4/ax_pkg_swig.m4: New file from the autoconf archive.
* m4/m4_ax_swig_python.m4: Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-11 13:33:05 +02:00
Justus Winter
11392a80d9 python: PEP8 fixes.
Cherry picked from 0267c151.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-10 14:45:44 +02:00
Justus Winter
aade53a12b python: Delete trailing whitespace.
--
Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-10 13:30:30 +02:00
Justus Winter
000dbb5b9a python: Drop Debian packaging.
--
Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-10 13:21:34 +02:00
Justus Winter
f4ba16b31e python: Rename bindings.
--
Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-10 13:19:26 +02:00
Ben McGinnes
a7fbd5293e More GTK2 removal
* Missed a couple of files, these 2 go for the same reason as the
  previous 3.
2015-08-02 11:06:14 +10:00
Ben McGinnes
1cd0aef0af Removed GUI examples
* GUI examples written with pygtk, which has not been ported to Python
  3 and won't be as it is for GTK2 and GNOME is moving to GTK3.
* New GUI examples may be required in future using any of several GUI
  frameworks (e.g. wxPython, PyQt, PySide, PyGObject, etc.).
2015-08-02 11:01:02 +10:00
Ben McGinnes
90405ac84b
Python 3 port of PyME
* Port of PyME 0.9.0 for Python 2 to Python 3 along with most of the
  example scripts.
* Intended to be developed in parallel with the original Python 2
  version until such time as a rewrite of GPGME leads to developing an
  IO API in Python 3 from scratch.
* Python 3 PyME and API maintainer has entered, stage left with current
  GPG key ID 0x321E4E2373590E5D, primary fingerprint is "DB47 24E6 FA42
  86C9 2B4E  55C4 321E 4E23 7359 0E5D" and signing subkey fingerprint is
  "B7F0 FE75 9387 430D D0C5  8BDB 7FF2 D371 35C7 553C" for future
  reference with git commit signatures.
2015-05-17 05:31:35 +10:00
Ben McGinnes
29887c9b28 Explaining why not all scripts work
* Some of them cannot be properly tested on OS X, especially with GTK in
  the mix (it works on OS X, but is unlikely to be as easily accessible
  as Cocoa or Qt).
* Most major functions are showcased and do work, albeit sometimes with
  false positives of error messages, at least on OS X.
2015-05-17 05:14:47 +10:00
Ben McGinnes
c39cea7a07 Byte encoding
* More string updates.
* verifydetails.py still fails, but as Bernhard is still contactable, it
  might be worth him checking on it instead.
2015-05-17 05:07:12 +10:00
Ben McGinnes
0e6e6689ef No change, note added to explain why. 2015-05-17 04:57:26 +10:00
Ben McGinnes
40290507bc Strings vs. Bytes
* CLI input must be byte encoded.
2015-05-17 04:43:53 +10:00
Ben McGinnes
325b0ca341 More byte changes and passphrase changes
* exportimport works, but will still segfault for an as yet unknown
  reason.
* genkey produces a traceback error, but does create the key as
  intended.
* matched passphrase in signverify.
2015-05-17 04:22:53 +10:00
Ben McGinnes
ba3c9f2617 More bytes good
* Another string to byte change.
2015-05-17 04:09:38 +10:00
Ben McGinnes
1c87ecb86a Updated encrypt-to-all
* Changed plaintext string to byte literal.
* Nested key selection in a try/except statement in case of
  UnicodeEncodeError instances.
* Tested successfully on over 9,000 keys.
2015-05-17 04:03:49 +10:00
Ben McGinnes
24c738f5bb Passphrase update
* Changed example passphrase to something that meets the current minimum
  requirements.
2015-05-17 02:38:32 +10:00
Ben McGinnes
8345bf6f43 example email
* changed joe@foo.bar to joe@example.org as it is only a matter of time
  before ICANN actually creates bar as a gTLD, if they haven't already.
2015-05-17 02:35:24 +10:00
Ben McGinnes
4fc1239815 Updated string and key data
* Text changed to byte literals.
* Changed key type to RSA/RSA.
* Changed expiry to the future (2020).
2015-05-17 02:30:13 +10:00
Ben McGinnes
90079786c5 String type
* the plain text string must be bytes and not unicode.
* Expect most of the example code to have similar issues at present.
2015-05-09 04:53:46 +10:00
Ben McGinnes
ebd8734ad7 Python 3 port of PyME
* The entirety of the Python 3 port of PyME up to commit
  2145348ec54c6027f2ea20f695de0277e2871405
* The old commit log has been saved as
  lang/py3-pyme/docs/old-commits.log
* Can be viewed as a normal (separate) git repository at
  https://github.com/adversary-org/pyme3
* Utilising the submodule feature of git was deliberately skipped on
  humanitarian grounds (in order to prevent pain and suffering on the
  part of anyone having to manage this repository).
2015-05-06 03:09:44 +10:00
Werner Koch
139e798c87 Remove all trailing whitespace from source files
--
Command used:  sed -i 's,[ \t]*$,,' FILE
2012-09-25 15:29:49 +02:00
W. Trevor King
4cb408d33e .gitignore: flesh out rules and add subdirectory-.gitignores. 2012-04-20 16:05:11 +02:00
Werner Koch
a4c4ee1aae Generate the ChangeLog from commit logs.
* build-aux/gitlog-to-changelog: New script.  Taken from gnulib.
* build-aux/git-log-fix: New file.
* build-aux/git-log-footer: New file.
* build-aux/git-hook/commit-msg: New script.
* doc/HACKING: New file.
* ChangeLog: New file.
* Makefile.am (EXTRA_DIST): Add new files.
(gen-ChangeLog): New.
(dist-hook): Run gen-ChangeLog.
* autogen.sh: Install commit-msg hook for git.

Rename all ChangeLog files to ChangeLog-2011.
2011-12-02 11:36:37 +01:00
Moritz Schulte
c01087be85 2008-11-08 Moritz <moritz@gnu.org>
* gpgme.lisp (size-t): Wrong call to defctype: function accepts
	optional, not keyword argument.
	(ssize-t): Likewise.
	(off-t): Likewise.
	(gpgme-data-t, gpgme-ctx-t): Likewise.
	(gpgme-error-t): Likewise.
	(gpgme-error-no-signal-t): Likewise.
	(gpgme-err-code-t): Likewise.
	(gpgme-err-source-t): Likewise.
	(gpgme-sig-notation-t, gpgme-engine-info-t): Likewise.
	(gpgme-subkey-t): Likewise.
	(gpgme-key-sig-t): Likewise.
	(gpgme-user-id-t): Likewise.
	(gpgme-key-t): Likewise.
	(gpgme-data-cbs-t): Likewise.
	(gpgme-invalid-key-t): Likewise.
	(gpgme-op-encrypt-result-t): Likewise.
	(gpgme-recipient-t): Likewise.
	(gpgme-op-decrypt-result-t): Likewise.
	(gpgme-new-signature-t): Likewise.
	(gpgme-op-sign-result-t): Likewise.
	(gpgme-signature-t): Likewise.
	(gpgme-op-verify-result-t): Likewise.
	(gpgme-import-status-t): Likewise.
	(gpgme-op-import-result-t): Likewise.
	(gpgme-op-genkey-result-t): Likewise.
	(gpgme-op-keylist-result-t): Likewise.
2008-11-23 18:09:57 +00:00
Marcus Brinkmann
1ae2788117 2006-07-06 Marcus Brinkmann <marcus@g10code.de>
* lang, lang/cl: New subdirectories.
	* lang/Makefile.am, lang/README: New files.
	* configure.ac (AC_CONFIG_FILES): Add lang/Makefile,
	lang/cl/Makefile and lang/cl/gpgme.asd.
	* Makefile.am (SUBDIRS): Add lang.

lang/cl/
2006-07-06  Marcus Brinkmann  <marcus@g10code.de>

	* Initial release.
2006-07-06 10:37:52 +00:00