[gtk-vnc-devel] [PATCH] Make VncDisplay.send_keys() return a PyObject



Regards,

Anthony Liguori
Return a PyObject for VncDisplay.send_keys()

diff -r d6f1a50dbb0b src/vnc.override
--- a/src/vnc.override	Sun Oct 21 17:11:07 2007 -0300
+++ b/src/vnc.override	Tue Oct 23 22:11:12 2007 -0500
@@ -23,11 +23,15 @@ _wrap_vnc_display_send_keys(PyGObject *s
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs,    
                                      "O:VncDisplay.send_keys", kwlist,
-                                     &keyList))
-        return;
+                                     &keyList)) {
+	Py_INCREF(Py_None);
+        return Py_None;
+    }
 
-    if (!PyList_Check(keyList))
-        return;
+    if (!PyList_Check(keyList)) {
+	Py_INCREF(Py_None);
+        return Py_None;
+    }
 
     len = PyList_Size(keyList);
     keys = malloc(sizeof(guint)*len);
@@ -38,11 +42,15 @@ _wrap_vnc_display_send_keys(PyGObject *s
         sym = PyString_AsString(val);
         if (!sym) {
             free(keys);
-            return;
+	    Py_INCREF(Py_None);
+            return Py_None;
         }
         keys[i] = gdk_keyval_from_name(sym);
     }
 
     vnc_display_send_keys(VNC_DISPLAY(self->obj), keys, len);
     free(keys);
+
+    Py_INCREF(Py_None);
+    return Py_None;
 }


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