diff options
author | Todd Zullinger <tmz@pobox.com> | 2008-07-08 21:00:50 -0400 |
---|---|---|
committer | Todd Zullinger <tmz@pobox.com> | 2008-07-08 21:00:50 -0400 |
commit | 12cbb8bdb7dfe735ece32574039f4fc206dff545 (patch) | |
tree | f40f0020aaba41f5b15a616dbf4e3fd60496975b | |
parent | 384fb5393b70d1ab3ed75bae1c4a91a5c7c2d998 (diff) | |
download | libgpod-python-quiet-tests.tar.gz libgpod-python-quiet-tests.tar.xz libgpod-python-quiet-tests.zip |
Add a quiet parameter to Database.remove() and use it in the test suitepython-quiet-tests
-rw-r--r-- | bindings/python/ipod.py | 5 | ||||
-rw-r--r-- | bindings/python/tests/tests.py | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/bindings/python/ipod.py b/bindings/python/ipod.py index 29a4a9a..b85875f 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. @@ -189,7 +189,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)) diff --git a/bindings/python/tests/tests.py b/bindings/python/tests/tests.py index f52015e..9f41617 100644 --- a/bindings/python/tests/tests.py +++ b/bindings/python/tests/tests.py @@ -62,7 +62,7 @@ class TestiPodFunctions(unittest.TestCase): track = self.db[0] track_file = track.ipod_filename() self.assertEqual(len(self.db),n) - self.db.remove(track, ipod=True) + self.db.remove(track, ipod=True, quiet=True) self.failIf(os.path.exists(track_file)) def testDatestampSetting(self): |