summaryrefslogtreecommitdiff
path: root/multimedia/quodlibet-plugins/loggerfix.diff
blob: a396b2c5f01f0068ae4d06e07d71e89542cdb756 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- events/lastfmsubmit.py.orig	2007-11-25 14:45:54.000000000 +0100
+++ events/lastfmsubmit.py	2007-11-25 17:22:59.000000000 +0100
@@ -27,10 +27,13 @@
     __exclude = ""
     __song = None
     __timeout_id = -1
-    __log = lastfm.logger('quodlibet')
+    __cli = None
 
     def __init__(self):
-        try: self.__exclude = config.get("plugins", "scrobbler_exclude")
+        try: 
+            self.__exclude = config.get("plugins", "scrobbler_exclude")
+            __cli = lastfm.client.Client('quodlibet')
+            __cli.open_log()
         except: pass
 
     def unprepare(self):
@@ -131,6 +134,6 @@
         for key in data.keys():
             if not data[key]: del(data[key])
         try:
-            lastfm.submit([data])
-            self.__log.info("Sent %s", lastfm.repr(data))
-        except IOError, e: self.__log.error("Error: %s" % e)
+            self.__cli.submit([data])
+            self.__cli.log.info("Sent %s", lastfm.repr(data))
+        except IOError, e: self.__cli.log.error("Error: %s" % e)