aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-07-28 13:24:05 +0000
committerJustus Winter <[email protected]>2016-07-28 13:26:43 +0000
commitb5aa05c3b261c3846ebbcf76e7505cff5459f918 (patch)
tree3274237139c81103aa9395b0572efea00a8dfcd7
parentpython: Rename private functions. (diff)
downloadgpgme-b5aa05c3b261c3846ebbcf76e7505cff5459f918.tar.gz
gpgme-b5aa05c3b261c3846ebbcf76e7505cff5459f918.zip
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 <[email protected]>
-rw-r--r--lang/python/helpers.c14
-rw-r--r--lang/python/helpers.h12
-rw-r--r--lang/python/pyme/core.py30
3 files changed, 28 insertions, 28 deletions
diff --git a/lang/python/helpers.c b/lang/python/helpers.c
index 27e7274c..0406f9f8 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 f41d327c..16a9b9fd 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 b25808dc..f5cc69c3 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: