summaryrefslogtreecommitdiffstats
path: root/bindings/python
diff options
context:
space:
mode:
authornicholas <nicholas@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2006-04-08 21:02:31 +0000
committernicholas <nicholas@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2006-04-08 21:02:31 +0000
commit30094a39e70cb39a842c7a04abb5c20e61c2014e (patch)
tree966e29b3b36f92a888224d52951565cdaab370b9 /bindings/python
parent3b22b67561e5fc9f1a7d563552fe9f462b5aa5ba (diff)
downloadlibgpod-30094a39e70cb39a842c7a04abb5c20e61c2014e.tar.gz
libgpod-30094a39e70cb39a842c7a04abb5c20e61c2014e.tar.xz
libgpod-30094a39e70cb39a842c7a04abb5c20e61c2014e.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
Diffstat (limited to 'bindings/python')
-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;