[git] GPGME - branch, master, updated. gpgme-1.11.1-289-g362caaf
by Ben McGinnes
cvs at cvs.gnupg.org
Tue Sep 18 00:33:39 CEST 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".
The branch, master has been updated
via 362caaf02f3a25b7e626572aa30b87771c2c8f4d (commit)
from f4d83800d89173e618cceca44b584778217fadb3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 362caaf02f3a25b7e626572aa30b87771c2c8f4d
Author: Ben McGinnes <ben at adversary.org>
Date: Tue Sep 18 08:32:30 2018 +1000
docs: python bindings
* Updated the Cython example code slightly, along with the
corresponding explanation.
diff --git a/doc/gpgme-python-howto.texi b/doc/gpgme-python-howto.texi
index 8073a90..7cdce1e 100644
--- a/doc/gpgme-python-howto.texi
+++ b/doc/gpgme-python-howto.texi
@@ -2120,8 +2120,9 @@ publist = list(pubkeys)
pubnum = len(publist)
print("""
- Number of secret keys: @{0@}
- Number of public keys: @{1@}
+ Number of secret keys: @{0@}
+ Number of public keys: @{1@}
+
""".format(secnum, pubnum))
@end example
@@ -2172,7 +2173,10 @@ On the other hand it ran in nearly half the time; taking 6 minutes and
which the CPython script alone took.
The @samp{keycount.pyx} and @samp{setup.py} files used to generate this example
-have been added to the @samp{examples/howto/advanced/cython/} directory.
+have been added to the @samp{examples/howto/advanced/cython/} directory
+The example versions include some additional options to annotate the
+existing code and to detect Cython's use. The latter comes from the
+ at uref{http://docs.cython.org/en/latest/src/tutorial/pure.html#magic-attributes-within-the-pxd, Magic Attributes} section of the Cython documentation.
@node Miscellaneous work-arounds
@chapter Miscellaneous work-arounds
diff --git a/lang/python/docs/gpgme-python-howto.org b/lang/python/docs/gpgme-python-howto.org
index 0d7f9b4..0836d21 100644
--- a/lang/python/docs/gpgme-python-howto.org
+++ b/lang/python/docs/gpgme-python-howto.org
@@ -2025,8 +2025,9 @@ publist = list(pubkeys)
pubnum = len(publist)
print("""
- Number of secret keys: {0}
- Number of public keys: {1}
+ Number of secret keys: {0}
+ Number of public keys: {1}
+
""".format(secnum, pubnum))
#+END_SRC
@@ -2077,7 +2078,10 @@ On the other hand it ran in nearly half the time; taking 6 minutes and
which the CPython script alone took.
The =keycount.pyx= and =setup.py= files used to generate this example
-have been added to the =examples/howto/advanced/cython/= directory.
+have been added to the =examples/howto/advanced/cython/= directory
+The example versions include some additional options to annotate the
+existing code and to detect Cython's use. The latter comes from the
+[[http://docs.cython.org/en/latest/src/tutorial/pure.html#magic-attributes-within-the-pxd][Magic Attributes]] section of the Cython documentation.
* Miscellaneous work-arounds
diff --git a/lang/python/examples/howto/advanced/cython/keycount.pyx b/lang/python/examples/howto/advanced/cython/keycount.pyx
index f0097db..2aa636d 100755
--- a/lang/python/examples/howto/advanced/cython/keycount.pyx
+++ b/lang/python/examples/howto/advanced/cython/keycount.pyx
@@ -1,3 +1,6 @@
+from __future__ import absolute_import
+
+import cython
import gpg
c = gpg.Context()
@@ -10,7 +13,14 @@ secnum = len(seclist)
publist = list(pubkeys)
pubnum = len(publist)
+if cython.compiled is True:
+ cc = "Powered by Cython compiled C code."
+else:
+ cc = "Powered by Python."
+
print("""
-Number of secret keys: {0}
-Number of public keys: {1}
-""".format(secnum, pubnum))
+ Number of secret keys: {0}
+ Number of public keys: {1}
+
+ {2}
+""".format(secnum, pubnum, cc))
diff --git a/lang/python/examples/howto/advanced/cython/setup.py b/lang/python/examples/howto/advanced/cython/setup.py
index 0d0be01..f8dce03 100644
--- a/lang/python/examples/howto/advanced/cython/setup.py
+++ b/lang/python/examples/howto/advanced/cython/setup.py
@@ -2,5 +2,5 @@ from distutils.core import setup
from Cython.Build import cythonize
setup(
- ext_modules = cythonize("keycount.pyx")
+ ext_modules = cythonize("keycount.pyx", annotate=True)
)
-----------------------------------------------------------------------
Summary of changes:
doc/gpgme-python-howto.texi | 10 +++++++---
lang/python/docs/gpgme-python-howto.org | 10 +++++++---
lang/python/examples/howto/advanced/cython/keycount.pyx | 16 +++++++++++++---
lang/python/examples/howto/advanced/cython/setup.py | 2 +-
4 files changed, 28 insertions(+), 10 deletions(-)
hooks/post-receive
--
GnuPG Made Easy
http://git.gnupg.org
More information about the Gnupg-commits
mailing list