summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Piper <nicholas@users.sourceforge.net>2006-04-08 21:02:31 +0000
committerNicholas Piper <nicholas@users.sourceforge.net>2006-04-08 21:02:31 +0000
commitde94dbec8470b576f057a0862f7316b93559e6a5 (patch)
tree966e29b3b36f92a888224d52951565cdaab370b9
parent75805d1ef2e43f6c93dd36c6e172c74b4bb99bc6 (diff)
downloadlibgpod-de94dbec8470b576f057a0862f7316b93559e6a5.tar.gz
libgpod-de94dbec8470b576f057a0862f7316b93559e6a5.tar.xz
libgpod-de94dbec8470b576f057a0862f7316b93559e6a5.zip
Allow fetching guint8 values into Python. Include function name in exception when checking guint8.
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1241 f01d2545-417e-4e96-918e-98f8d0dbbcb6
-rw-r--r--bindings/python/gpod.i6
1 files changed, 5 insertions, 1 deletions
diff --git a/bindings/python/gpod.i b/bindings/python/gpod.i
index 482e5eb..1c0edc7 100644
--- a/bindings/python/gpod.i
+++ b/bindings/python/gpod.i
@@ -81,13 +81,17 @@ typedef char gchar;
long ival;
ival = PyInt_AsLong($input);
if (( ival > 255 ) || ( ival < 0 )) {
- PyErr_SetString(PyExc_ValueError, "Value must be between 0 and 255");
+ PyErr_SetString(PyExc_ValueError, "$symname: Value must be between 0 and 255");
SWIG_fail;
} else {
$1 = (guint8) ival;
}
}
+%typemap(out) guint8 {
+ $result = PyInt_FromLong($1);
+}
+
typedef int gboolean;
typedef int gint32;