From 27e708ef6565c6f5427a00e39e90f7e59aba2a3e Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Sat, 23 Aug 2008 18:01:32 +0000 Subject: Python: Add a quiet parameter to Database.remove() and use it in tests git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@2109 f01d2545-417e-4e96-918e-98f8d0dbbcb6 --- bindings/python/ipod.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bindings/python/ipod.py') diff --git a/bindings/python/ipod.py b/bindings/python/ipod.py index 7048955..80b5858 100644 --- a/bindings/python/ipod.py +++ b/bindings/python/ipod.py @@ -155,7 +155,7 @@ class Database: gpod.itdb_track_add(self._itdb, track._track, pos) track.__database = self # so the db doesn't get gc'd - def remove(self, item, harddisk=False, ipod=True): + def remove(self, item, harddisk=False, ipod=True, quiet=False): """Remove a playlist or track from a database. item is either a playlist or track object. @@ -164,6 +164,8 @@ class Database: If ipod is True the item will be removed from the iPod. + If quiet is True no message will be printed for removed tracks + """ if isinstance(item, Playlist): @@ -189,7 +191,8 @@ class Database: filename = item.ipod_filename() if filename and os.path.exists(filename): os.unlink(filename) - print "unlinked %s" % filename + if not quiet: + print "unlinked %s" % filename gpod.itdb_track_unlink(item._track) else: raise DatabaseException("Unable to remove a %s from database" % type(item)) -- cgit