pybank r73 - in trunk: . bank



Author: johan
Date: Mon Sep 15 16:28:46 2008
New Revision: 73
URL: http://svn.gnome.org/viewvc/pybank?rev=73&view=rev

Log:
2008-09-15  Johan Dahlin  <jdahlin async com br>

    Bug 551169 â fix pixbuf example in pybank

    * bank/bank-argument.c (pyg_argument_from_pyobject),
    (pyg_argument_to_pyobject):
    * simple2.py:
    Patch by Jani Monoses



Modified:
   trunk/ChangeLog
   trunk/bank/bank-argument.c
   trunk/simple2.py

Modified: trunk/bank/bank-argument.c
==============================================================================
--- trunk/bank/bank-argument.c	(original)
+++ trunk/bank/bank-argument.c	Mon Sep 15 16:28:46 2008
@@ -48,6 +48,12 @@
 	else
 	    arg.v_pointer = PyCObject_AsVoidPtr(object);
 	break;
+    case GI_TYPE_TAG_ERROR:
+        /* Allow NULL GError, otherwise fall through */
+        if (object == Py_None) {
+            arg.v_pointer = NULL;
+            break;
+        }
     default:
 	g_print("<PyO->GArg> GITypeTag %s is unhandled\n",
 		g_type_tag_to_string(type_tag));
@@ -75,6 +81,9 @@
     case GI_TYPE_TAG_BOOLEAN:
 	obj = PyBool_FromLong(arg->v_int);
 	break;
+    case GI_TYPE_TAG_UINT8:
+	obj = PyInt_FromLong(arg->v_uint8);
+	break;
     case GI_TYPE_TAG_INT:
 	obj = PyInt_FromLong(arg->v_int);
 	break;

Modified: trunk/simple2.py
==============================================================================
--- trunk/simple2.py	(original)
+++ trunk/simple2.py	Mon Sep 15 16:28:46 2008
@@ -4,6 +4,5 @@
 import GdkPixbuf
 
 filename = sys.argv[1]
-p = GdkPixbuf.GdkPixbuf.new_from_file(filename)
+p = GdkPixbuf.Pixbuf.new_from_file(filename, None)
 print 'Size of %s is %dx%d' % (filename, p.get_width(), p.get_height())
-print len(p.get_pixels())



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]