Revision: 2109
http://gtkpod.svn.sourceforge.net/gtkpod/?rev=2109&view=rev
Author: tmzullinger
Date: 2008-08-23 18:01:32 +0000 (Sat, 23 Aug 2008)
Log Message:
-----------
Python: Add a quiet parameter to Database.remove() and use it in tests
Modified Paths:
--------------
libgpod/trunk/ChangeLog
libgpod/trunk/bindings/python/ipod.py
libgpod/trunk/bindings/python/tests/tests.py
Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog 2008-08-20 17:37:32 UTC (rev 2108)
+++ libgpod/trunk/ChangeLog 2008-08-23 18:01:32 UTC (rev 2109)
@@ -1,5 +1,12 @@
-2008-08-09 Todd Zullinger <tmzullinger at users.sourceforge.net>
+2008-08-23 Todd Zullinger <tmzullinger at users.sourceforge.net>
+ * bindings/python/ipod.py
+ bindings/python/tests/tests.py:
+ Add a quiet parameter to Database.remove() and use it in
+ tests
+
+2008-08-20 Todd Zullinger <tmzullinger at users.sourceforge.net>
+
* bindings/python/examples/save_photos.py
bindings/python/gpod.i.in
bindings/python/ipod.py
Modified: libgpod/trunk/bindings/python/ipod.py
===================================================================
--- libgpod/trunk/bindings/python/ipod.py 2008-08-20 17:37:32 UTC (rev
2108)
+++ libgpod/trunk/bindings/python/ipod.py 2008-08-23 18:01:32 UTC (rev
2109)
@@ -155,7 +155,7 @@
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 @@
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 @@
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))
Modified: libgpod/trunk/bindings/python/tests/tests.py
===================================================================
--- libgpod/trunk/bindings/python/tests/tests.py 2008-08-20 17:37:32 UTC
(rev 2108)
+++ libgpod/trunk/bindings/python/tests/tests.py 2008-08-23 18:01:32 UTC
(rev 2109)
@@ -62,7 +62,7 @@
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):
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2