summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2008-07-17 11:06:58 +0000
committerJohan Dahlin <johan@src.gnome.org>2008-07-17 11:06:58 +0000
commit3d9ab4ee631a171357b06b0bc70f37ea79b912da (patch)
tree76cd40994f81448c40a66994e1b0b1ac150f406b
parent01b5595d907cef0638e027a26218505ecd942239 (diff)
downloadpygobject-3d9ab4ee631a171357b06b0bc70f37ea79b912da.tar.gz
pygobject-3d9ab4ee631a171357b06b0bc70f37ea79b912da.tar.xz
pygobject-3d9ab4ee631a171357b06b0bc70f37ea79b912da.zip
Add a pygio_version module attribute
2008-07-17 Johan Dahlin <johan@gnome.org> * gio/giomodule.c (init_gio): Add a pygio_version module attribute svn path=/trunk/; revision=820
-rw-r--r--ChangeLog5
-rw-r--r--gio/giomodule.c16
2 files changed, 19 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 960e8f2..a91285a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2008-07-17 Johan Dahlin <johan@gnome.org>
+ * gio/giomodule.c (init_gio):
+ Add a pygio_version module attribute
+
+2008-07-17 Johan Dahlin <johan@gnome.org>
+
* gio/gio-types.defs:
Rename gio.IOErrorEnum to gio.ErrorEnum
diff --git a/gio/giomodule.c b/gio/giomodule.c
index e7c852c..469c55d 100644
--- a/gio/giomodule.c
+++ b/gio/giomodule.c
@@ -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 @@ DL_EXPORT(void)
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 @@ init_gio(void)
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);
}