summaryrefslogtreecommitdiffstats
path: root/bindings/python/examples
diff options
context:
space:
mode:
authorNicholas Piper <nicholas@users.sourceforge.net>2006-04-09 16:38:12 +0000
committerNicholas Piper <nicholas@users.sourceforge.net>2006-04-09 16:38:12 +0000
commit08de30de7733b07a17eed911ca1d4f02b030ad42 (patch)
treebf60b90d0264d105ca06038d2da0137e58c926f3 /bindings/python/examples
parentde94dbec8470b576f057a0862f7316b93559e6a5 (diff)
downloadlibgpod-08de30de7733b07a17eed911ca1d4f02b030ad42.tar.gz
libgpod-08de30de7733b07a17eed911ca1d4f02b030ad42.tar.xz
libgpod-08de30de7733b07a17eed911ca1d4f02b030ad42.zip
Very start of a much nicer API from Python
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1242 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'bindings/python/examples')
-rw-r--r--bindings/python/examples/Makefile.am4
-rwxr-xr-xbindings/python/examples/playwith_ipod_api.py14
2 files changed, 17 insertions, 1 deletions
diff --git a/bindings/python/examples/Makefile.am b/bindings/python/examples/Makefile.am
index 93cf41c..89f76fc 100644
--- a/bindings/python/examples/Makefile.am
+++ b/bindings/python/examples/Makefile.am
@@ -1,2 +1,4 @@
-EXTRA_DIST = coverart_fetch.py toy_around.py tag_genre_from_audioscrobber.py add_song.py
+EXTRA_DIST = coverart_fetch.py toy_around.py \
+ tag_genre_from_audioscrobber.py add_song.py \
+ playwith_ipod_api.py
diff --git a/bindings/python/examples/playwith_ipod_api.py b/bindings/python/examples/playwith_ipod_api.py
new file mode 100755
index 0000000..544de5b
--- /dev/null
+++ b/bindings/python/examples/playwith_ipod_api.py
@@ -0,0 +1,14 @@
+#!/usr/bin/python
+
+import ipod
+
+db = ipod.Database()
+
+for track in db[4:20]:
+ print track
+ print track['title']
+
+filename = "/mp3/Blondie/No_Exit/Blondie_-_Maria.mp3"
+t = ipod.Track(from_file=filename)
+print t
+