diff options
author | Nicholas Piper <nicholas@users.sourceforge.net> | 2007-07-12 13:15:26 +0000 |
---|---|---|
committer | Nicholas Piper <nicholas@users.sourceforge.net> | 2007-07-12 13:15:26 +0000 |
commit | 37282e5cadf7654d617392b7118461bd66e12c8e (patch) | |
tree | c312c66ce03ff4939cb01d282f1b1c938d2c0b5e | |
parent | 75e3efd0184c7c5a93479ee812f8b888debf94af (diff) | |
download | libgpod-37282e5cadf7654d617392b7118461bd66e12c8e.tar.gz libgpod-37282e5cadf7654d617392b7118461bd66e12c8e.tar.xz libgpod-37282e5cadf7654d617392b7118461bd66e12c8e.zip |
Add version and version_info attributes to the Python bindings
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1633 f01d2545-417e-4e96-918e-98f8d0dbbcb6
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | bindings/python/gpod.i.in | 8 | ||||
-rw-r--r-- | bindings/python/tests/tests.py | 6 | ||||
-rw-r--r-- | configure.ac | 3 |
4 files changed, 21 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2007-07-12 Nicholas Piper <nicholas at users.sourceforge.net> + + * bindings/python/gpod.i.in: Add version and version_info + attributes to the Python bindings + 2007-07-11 Todd Zullinger <tmzullinger at users.sourceforge.net> * bindings/python/Makefile.am: diff --git a/bindings/python/gpod.i.in b/bindings/python/gpod.i.in index bd924c9..f8364eb 100644 --- a/bindings/python/gpod.i.in +++ b/bindings/python/gpod.i.in @@ -38,6 +38,13 @@ Python. See the main gpod module for a more traditional Python interface." %enddef +%pythoncode %{ +version_info = (@LIBGPOD_MAJOR_VERSION@, + @LIBGPOD_MINOR_VERSION@, + @LIBGPOD_MICRO_VERSION@) +version = '.'.join(map(str, version_info)) +%} + %module(docstring=DOCSTRING) gpod %{ #include "db-artwork-debug.h" @@ -50,6 +57,7 @@ interface." #include "itdb_private.h" #include <gdk-pixbuf/gdk-pixbuf.h> + /* include prototypes for all functions so builds using * -Wmissing-prototypes don't fail. */ PyObject* sw_get_tracks(Itdb_iTunesDB *itdb); diff --git a/bindings/python/tests/tests.py b/bindings/python/tests/tests.py index c402ac1..bdae7cb 100644 --- a/bindings/python/tests/tests.py +++ b/bindings/python/tests/tests.py @@ -2,6 +2,7 @@ import unittest import shutil import tempfile import os +import types gpod = __import__('__init__') @@ -61,6 +62,9 @@ class TestiPodFunctions(unittest.TestCase): self.assertEqual(len(self.db),n) self.db.remove(track, ipod=True) self.failIf(os.path.exists(track_file)) - + + def testVersion(self): + self.assertEqual(type(gpod.version_info), + types.TupleType) if __name__ == '__main__': unittest.main() diff --git a/configure.ac b/configure.ac index eadb9b8..0f4f753 100644 --- a/configure.ac +++ b/configure.ac @@ -27,6 +27,9 @@ dnl libtool versioning LIBGPOD_SO_VERSION=2:0:0 AC_SUBST(LIBGPOD_SO_VERSION) +AC_SUBST(LIBGPOD_MAJOR_VERSION) +AC_SUBST(LIBGPOD_MINOR_VERSION) +AC_SUBST(LIBGPOD_MICRO_VERSION) AC_SUBST(LIBGPOD_VERSION) AM_INIT_AUTOMAKE(libgpod, $LIBGPOD_VERSION) |