summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Piper <nicholas@users.sourceforge.net>2006-04-07 15:02:48 +0000
committerNicholas Piper <nicholas@users.sourceforge.net>2006-04-07 15:02:48 +0000
commitcbf9ee64039b583cb284e67b1b63f74b622028f7 (patch)
treef28e99e2f717f288fd8d7182a4c3e89c109d009f
parent948e052984ab28bb5ea16c733e12aaaff15866fa (diff)
downloadlibgpod-cbf9ee64039b583cb284e67b1b63f74b622028f7.tar.gz
libgpod-cbf9ee64039b583cb284e67b1b63f74b622028f7.tar.xz
libgpod-cbf9ee64039b583cb284e67b1b63f74b622028f7.zip
Cleanup temp files after we're done.
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1230 f01d2545-417e-4e96-918e-98f8d0dbbcb6
-rwxr-xr-xbindings/python/examples/coverart_fetch.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/bindings/python/examples/coverart_fetch.py b/bindings/python/examples/coverart_fetch.py
index a2e10c8..398dfba 100755
--- a/bindings/python/examples/coverart_fetch.py
+++ b/bindings/python/examples/coverart_fetch.py
@@ -90,7 +90,13 @@ for track in gpod.sw_get_tracks(itdb):
print "Added thumbnails for %s, %s" % (track.album,track.artist)
except KeyError:
print "No image available for %s, %s" % (track.album,track.artist)
-
+print "Cleaning up downloaded images..."
+# really, we should do this if any of the real work threw an exception
+# too. This is just a demo script :-)
+for filename in images.values():
+ os.unlink(filename)
+
+print "Writing ipod database..."
gpod.itdb_write(itdb, None)
-print "Saved db"
+