Author: duncan
Date: Sat Feb 23 10:47:57 2008
New Revision: 10420
Log:
Fix for saveFavorites, just to be certain it does not complain if it fails
Updated messages for coversearch
Modified:
branches/rel-1-7/freevo/src/audio/plugins/coversearch.py
branches/rel-1-7/freevo/src/tv/record_types.py
branches/rel-1/freevo/src/audio/plugins/coversearch.py
branches/rel-1/freevo/src/tv/record_types.py
Modified: branches/rel-1-7/freevo/src/audio/plugins/coversearch.py
==============================================================================
--- branches/rel-1-7/freevo/src/audio/plugins/coversearch.py (original)
+++ branches/rel-1-7/freevo/src/audio/plugins/coversearch.py Sat Feb 23
10:47:57 2008
@@ -143,11 +143,11 @@
return []
if item.type in ('audio', 'audiocd', 'dir'):
- _debug_('type=\"%s\"' % item.type)
- _debug_('name=\"%s\"' % item['name'])
- _debug_(hasattr(item, 'artist') and 'artist="%s"' %
item.getattr('artist') or 'NO artist')
- _debug_(hasattr(item, 'album') and 'album="%s"' %
item.getattr('album') or 'NO album')
- _debug_(hasattr(item, 'title') and 'title="%s"' %
item.getattr('title') or 'NO title')
+ _debug_('type=%r' % item.type)
+ _debug_('name=%r' % item['name'])
+ _debug_(hasattr(item, 'artist') and 'artist=%r' %
item.getattr('artist') or 'NO artist')
+ _debug_(hasattr(item, 'album') and 'album=%r' %
item.getattr('album') or 'NO album')
+ _debug_(hasattr(item, 'title') and 'title=%r' %
item.getattr('title') or 'NO title')
try:
if not hasattr(item, 'artist'):
if item.type in ('audio', 'dir') and not hasattr(item,
'album'):
Modified: branches/rel-1-7/freevo/src/tv/record_types.py
==============================================================================
--- branches/rel-1-7/freevo/src/tv/record_types.py (original)
+++ branches/rel-1-7/freevo/src/tv/record_types.py Sat Feb 23 10:47:57 2008
@@ -102,9 +102,12 @@
def saveFavorites(self):
""" """
- favorites_fh = open(self.favorites_file_name, 'wb')
- pickle.dump(self.favorites, favorites_fh)
- favorites_fh.close()
+ try:
+ favorites_fh = open(self.favorites_file_name, 'wb')
+ pickle.dump(self.favorites, favorites_fh)
+ favorites_fh.close()
+ except Exception, why:
+ print Exception, why
print 'DJW:self.favorites=%r' % (self.favorites,)
for favorite in self.favorites:
print 'DJW:favorite=%r' % (favorite,)
Modified: branches/rel-1/freevo/src/audio/plugins/coversearch.py
==============================================================================
--- branches/rel-1/freevo/src/audio/plugins/coversearch.py (original)
+++ branches/rel-1/freevo/src/audio/plugins/coversearch.py Sat Feb 23
10:47:57 2008
@@ -143,11 +143,11 @@
return []
if item.type in ('audio', 'audiocd', 'dir'):
- _debug_('type=\"%s\"' % item.type)
- _debug_('name=\"%s\"' % item['name'])
- _debug_(hasattr(item, 'artist') and 'artist="%s"' %
item.getattr('artist') or 'NO artist')
- _debug_(hasattr(item, 'album') and 'album="%s"' %
item.getattr('album') or 'NO album')
- _debug_(hasattr(item, 'title') and 'title="%s"' %
item.getattr('title') or 'NO title')
+ _debug_('type=%r' % item.type)
+ _debug_('name=%r' % item['name'])
+ _debug_(hasattr(item, 'artist') and 'artist=%r' %
item.getattr('artist') or 'NO artist')
+ _debug_(hasattr(item, 'album') and 'album=%r' %
item.getattr('album') or 'NO album')
+ _debug_(hasattr(item, 'title') and 'title=%r' %
item.getattr('title') or 'NO title')
try:
if not hasattr(item, 'artist'):
if item.type in ('audio', 'dir') and not hasattr(item,
'album'):
Modified: branches/rel-1/freevo/src/tv/record_types.py
==============================================================================
--- branches/rel-1/freevo/src/tv/record_types.py (original)
+++ branches/rel-1/freevo/src/tv/record_types.py Sat Feb 23 10:47:57 2008
@@ -102,9 +102,12 @@
def saveFavorites(self):
""" """
- favorites_fh = open(self.favorites_file_name, 'wb')
- pickle.dump(self.favorites, favorites_fh)
- favorites_fh.close()
+ try:
+ favorites_fh = open(self.favorites_file_name, 'wb')
+ pickle.dump(self.favorites, favorites_fh)
+ favorites_fh.close()
+ except Exception, why:
+ print Exception, why
print 'DJW:self.favorites=%r' % (self.favorites,)
for favorite in self.favorites:
print 'DJW:favorite=%r' % (favorite,)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog