pygobject r820 - in trunk: . gio



Author: johan
Date: Thu Jul 17 11:06:58 2008
New Revision: 820
URL: http://svn.gnome.org/viewvc/pygobject?rev=820&view=rev

Log:
2008-07-17  Johan Dahlin  <johan gnome org>

        * gio/giomodule.c (init_gio):
        Add a pygio_version module attribute



Modified:
   trunk/ChangeLog
   trunk/gio/giomodule.c

Modified: trunk/gio/giomodule.c
==============================================================================
--- trunk/gio/giomodule.c	(original)
+++ trunk/gio/giomodule.c	Thu Jul 17 11:06:58 2008
@@ -27,6 +27,10 @@
 
 #include <gio/gio.h>
 
+#define PYGIO_MAJOR_VERSION PYGOBJECT_MAJOR_VERSION
+#define PYGIO_MINOR_VERSION PYGOBJECT_MINOR_VERSION
+#define PYGIO_MICRO_VERSION PYGOBJECT_MICRO_VERSION
+
 /* include any extra headers needed here */
 
 void pygio_register_classes(PyObject *d);
@@ -38,7 +42,8 @@
 init_gio(void)
 {
     PyObject *m, *d;
-
+    PyObject *tuple;
+    
     /* perform any initialisation required by the library here */
 
     m = Py_InitModule("_gio", pygio_functions);
@@ -50,6 +55,13 @@
     pygio_add_constants(m, "G_IO_");
 
     PyModule_AddStringConstant(m, "ERROR", g_quark_to_string(G_IO_ERROR));
-    
+
+    /* pygobject version */
+    tuple = Py_BuildValue ("(iii)",
+			   PYGIO_MAJOR_VERSION,
+			   PYGIO_MINOR_VERSION,
+			   PYGIO_MICRO_VERSION);
+    PyDict_SetItemString(d, "pygio_version", tuple); 
+    Py_DECREF(tuple);
 }
 



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