[kupfer] plugin.rhythmbox_support: Raise error when dbfile doesn't exist
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] plugin.rhythmbox_support: Raise error when dbfile doesn't exist
- Date: Thu, 10 Sep 2009 22:36:34 +0000 (UTC)
commit b015a89dc3a758153dfba3556eef943624f469bc
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Thu Sep 10 21:01:10 2009 +0200
plugin.rhythmbox_support: Raise error when dbfile doesn't exist
kupfer/plugin/rhythmbox_support.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/plugin/rhythmbox_support.py b/kupfer/plugin/rhythmbox_support.py
index 7b78b2b..020c74b 100644
--- a/kupfer/plugin/rhythmbox_support.py
+++ b/kupfer/plugin/rhythmbox_support.py
@@ -8,6 +8,8 @@ NEEDED_KEYS= ("title", "artist", "album", "track-number", "location", )
def get_rhythmbox_songs(typ="song", keys=NEEDED_KEYS,
dbfile='~/.local/share/rhythmbox/rhythmdb.xml'):
+ if not dbfile or not os.path.exists(dbfile):
+ raise IOError("Rhythmbox database not found")
rhythmbox_dbfile = os.path.expanduser(dbfile)
rbParser = xml.sax.make_parser()
lSongs = []
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]