[Pkg-gnupg-commit] [gpgme] 246/412: python: Rename exported functions.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Thu Sep 22 21:26:56 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gpgme.

commit b5aa05c3b261c3846ebbcf76e7505cff5459f918
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jul 28 15:24:05 2016 +0200

    python: Rename exported functions.
    
    Avoid the name pygpgme, as this is the name of another popular Python
    binding for GPGME.
    
    This commit renames all functions that are exported to the Python
    world.
    
    * lang/python/helpers.c: Rename all exported functions.
    * lang/python/helpers.h: Likewise.
    * lang/python/pyme/core.py: Likewise.
    
    Signed-off-by: Justus Winter <justus at g10code.com>
---
 lang/python/helpers.c    | 14 +++++++-------
 lang/python/helpers.h    | 12 ++++++------
 lang/python/pyme/core.py | 30 +++++++++++++++---------------
 3 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/lang/python/helpers.c b/lang/python/helpers.c
index 27e7274..0406f9f 100644
--- a/lang/python/helpers.c
+++ b/lang/python/helpers.c
@@ -123,7 +123,7 @@ static void _pyme_stash_callback_exception(PyObject *weak_self)
   Py_DECREF(excinfo);
 }
 
-PyObject *pygpgme_raise_callback_exception(PyObject *self)
+PyObject *pyme_raise_callback_exception(PyObject *self)
 {
   PyObject *ptype, *pvalue, *ptraceback, *excinfo;
 
@@ -413,7 +413,7 @@ static gpgme_error_t pyPassphraseCb(void *hook,
 }
 
 PyObject *
-pygpgme_set_passphrase_cb(PyObject *self, PyObject *cb) {
+pyme_set_passphrase_cb(PyObject *self, PyObject *cb) {
   PyObject *wrapped;
   gpgme_ctx_t ctx;
 
@@ -495,7 +495,7 @@ static void pyProgressCb(void *hook, const char *what, int type, int current,
 }
 
 PyObject *
-pygpgme_set_progress_cb(PyObject *self, PyObject *cb) {
+pyme_set_progress_cb(PyObject *self, PyObject *cb) {
   PyObject *wrapped;
   gpgme_ctx_t ctx;
 
@@ -592,7 +592,7 @@ static gpgme_error_t pyStatusCb(void *hook, const char *keyword,
 }
 
 PyObject *
-pygpgme_set_status_cb(PyObject *self, PyObject *cb) {
+pyme_set_status_cb(PyObject *self, PyObject *cb) {
   PyObject *wrapped;
   gpgme_ctx_t ctx;
 
@@ -910,9 +910,9 @@ static void pyDataReleaseCb(void *hook)
 }
 
 PyObject *
-pygpgme_data_new_from_cbs(PyObject *self,
-                          PyObject *pycbs,
-                          gpgme_data_t *r_data)
+pyme_data_new_from_cbs(PyObject *self,
+                       PyObject *pycbs,
+                       gpgme_data_t *r_data)
 {
   static struct gpgme_data_cbs cbs = {
     pyDataReadCb,
diff --git a/lang/python/helpers.h b/lang/python/helpers.h
index f41d327..16a9b9f 100644
--- a/lang/python/helpers.h
+++ b/lang/python/helpers.h
@@ -26,11 +26,11 @@
 #define write(fd, str, sz) {DWORD written; WriteFile((HANDLE) fd, str, sz, &written, 0);}
 #endif
 
-PyObject *pygpgme_raise_callback_exception(PyObject *self);
+PyObject *pyme_raise_callback_exception(PyObject *self);
 
-PyObject *pygpgme_set_passphrase_cb(PyObject *self, PyObject *cb);
-PyObject *pygpgme_set_progress_cb(PyObject *self, PyObject *cb);
-PyObject *pygpgme_set_status_cb(PyObject *self, PyObject *cb);
+PyObject *pyme_set_passphrase_cb(PyObject *self, PyObject *cb);
+PyObject *pyme_set_progress_cb(PyObject *self, PyObject *cb);
+PyObject *pyme_set_status_cb(PyObject *self, PyObject *cb);
 
-PyObject *pygpgme_data_new_from_cbs(PyObject *self, PyObject *pycbs,
-				    gpgme_data_t *r_data);
+PyObject *pyme_data_new_from_cbs(PyObject *self, PyObject *pycbs,
+				 gpgme_data_t *r_data);
diff --git a/lang/python/pyme/core.py b/lang/python/pyme/core.py
index b25808d..f5cc69c 100644
--- a/lang/python/pyme/core.py
+++ b/lang/python/pyme/core.py
@@ -126,13 +126,13 @@ class GpgmeWrapper(object):
             def _funcwrap(slf, *args):
                 result = func(slf.wrapped, *args)
                 if slf._callback_excinfo:
-                    pygpgme.pygpgme_raise_callback_exception(slf)
+                    pygpgme.pyme_raise_callback_exception(slf)
                 return errorcheck(result, "Invocation of " + name)
         else:
             def _funcwrap(slf, *args):
                 result = func(slf.wrapped, *args)
                 if slf._callback_excinfo:
-                    pygpgme.pygpgme_raise_callback_exception(slf)
+                    pygpgme.pyme_raise_callback_exception(slf)
                 return result
 
         doc = self._munge_docstring.sub(r'\2.\1(\3', getattr(func, "__doc__"))
@@ -508,7 +508,7 @@ class Context(GpgmeWrapper):
             errptr)
 
         if self._callback_excinfo:
-            pygpgme.pygpgme_raise_callback_exception(self)
+            pygpgme.pyme_raise_callback_exception(self)
 
         errorcheck(err)
 
@@ -661,10 +661,10 @@ class Context(GpgmeWrapper):
                 hookdata = (weakref.ref(self), func)
             else:
                 hookdata = (weakref.ref(self), func, hook)
-        pygpgme.pygpgme_set_passphrase_cb(self, hookdata)
+        pygpgme.pyme_set_passphrase_cb(self, hookdata)
 
     def _free_passcb(self):
-        if pygpgme.pygpgme_set_passphrase_cb:
+        if pygpgme.pyme_set_passphrase_cb:
             self.set_passphrase_cb(None)
 
     def set_progress_cb(self, func, hook=None):
@@ -686,10 +686,10 @@ class Context(GpgmeWrapper):
                 hookdata = (weakref.ref(self), func)
             else:
                 hookdata = (weakref.ref(self), func, hook)
-        pygpgme.pygpgme_set_progress_cb(self, hookdata)
+        pygpgme.pyme_set_progress_cb(self, hookdata)
 
     def _free_progresscb(self):
-        if pygpgme.pygpgme_set_progress_cb:
+        if pygpgme.pyme_set_progress_cb:
             self.set_progress_cb(None)
 
     def set_status_cb(self, func, hook=None):
@@ -710,10 +710,10 @@ class Context(GpgmeWrapper):
                 hookdata = (weakref.ref(self), func)
             else:
                 hookdata = (weakref.ref(self), func, hook)
-        pygpgme.pygpgme_set_status_cb(self, hookdata)
+        pygpgme.pyme_set_status_cb(self, hookdata)
 
     def _free_statuscb(self):
-        if pygpgme.pygpgme_set_status_cb:
+        if pygpgme.pyme_set_status_cb:
             self.set_status_cb(None)
 
     @property
@@ -774,7 +774,7 @@ class Context(GpgmeWrapper):
 
         result = pygpgme.gpgme_op_edit(self.wrapped, key, opaquedata, out)
         if self._callback_excinfo:
-            pygpgme.pygpgme_raise_callback_exception(self)
+            pygpgme.pyme_raise_callback_exception(self)
         errorcheck(result)
 
 class Data(GpgmeWrapper):
@@ -873,7 +873,7 @@ class Data(GpgmeWrapper):
         if self.wrapped != None and pygpgme.gpgme_data_release:
             pygpgme.gpgme_data_release(self.wrapped)
             if self._callback_excinfo:
-                pygpgme.pygpgme_raise_callback_exception(self)
+                pygpgme.pyme_raise_callback_exception(self)
             self.wrapped = None
         self._free_datacbs()
 
@@ -918,7 +918,7 @@ class Data(GpgmeWrapper):
         else:
             hookdata = (weakref.ref(self),
                         read_cb, write_cb, seek_cb, release_cb)
-        pygpgme.pygpgme_data_new_from_cbs(self, hookdata, tmp)
+        pygpgme.pyme_data_new_from_cbs(self, hookdata, tmp)
         self.wrapped = pygpgme.gpgme_data_t_p_value(tmp)
         pygpgme.delete_gpgme_data_t_p(tmp)
 
@@ -972,7 +972,7 @@ class Data(GpgmeWrapper):
         written = pygpgme.gpgme_data_write(self.wrapped, buffer)
         if written < 0:
             if self._callback_excinfo:
-                pygpgme.pygpgme_raise_callback_exception(self)
+                pygpgme.pyme_raise_callback_exception(self)
             else:
                 raise GPGMEError.fromSyserror()
         return written
@@ -993,7 +993,7 @@ class Data(GpgmeWrapper):
                 result = pygpgme.gpgme_data_read(self.wrapped, size)
             except:
                 if self._callback_excinfo:
-                    pygpgme.pygpgme_raise_callback_exception(self)
+                    pygpgme.pyme_raise_callback_exception(self)
                 else:
                     raise
             return result
@@ -1004,7 +1004,7 @@ class Data(GpgmeWrapper):
                     result = pygpgme.gpgme_data_read(self.wrapped, 4096)
                 except:
                     if self._callback_excinfo:
-                        pygpgme.pygpgme_raise_callback_exception(self)
+                        pygpgme.pyme_raise_callback_exception(self)
                     else:
                         raise
                 if len(result) == 0:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gpgme.git



More information about the Pkg-gnupg-commit mailing list