deskbar-applet r2091 - in trunk: . deskbar/handlers



Author: sebp
Date: Tue Apr  8 22:40:40 2008
New Revision: 2091
URL: http://svn.gnome.org/viewvc/deskbar-applet?rev=2091&view=rev

Log:
Replaced print statements with logger calls

Modified:
   trunk/ChangeLog
   trunk/deskbar/handlers/epiphany.py
   trunk/deskbar/handlers/files.py
   trunk/deskbar/handlers/iswitch-window.py
   trunk/deskbar/handlers/tomboy.py

Modified: trunk/deskbar/handlers/epiphany.py
==============================================================================
--- trunk/deskbar/handlers/epiphany.py	(original)
+++ trunk/deskbar/handlers/epiphany.py	Tue Apr  8 22:40:40 2008
@@ -314,8 +314,8 @@
             try:
                 parser.parse(EPHY_HISTORY_FILE)
             except Exception, e:
-                print "Couldn't parse epiphany history file:", e
-
+                LOGGER.error("Couldn't parse epiphany history file")
+                LOGGER.exception(e)
     
     def characters(self, chars):
         self.chars = self.chars + chars

Modified: trunk/deskbar/handlers/files.py
==============================================================================
--- trunk/deskbar/handlers/files.py	(original)
+++ trunk/deskbar/handlers/files.py	Tue Apr  8 22:40:40 2008
@@ -13,10 +13,11 @@
 import deskbar.interfaces.Module
 import gnomevfs
 import gtk
-import os, urllib
-
-
+import logging
+import os
+import urllib
 
+LOGGER = logging.getLogger(__name__)
 MONITOR = gnomevfs.VolumeMonitor()
 
 HANDLERS = ["FileFolderHandler"]
@@ -142,7 +143,7 @@
                          tail = head[i+1:]
                     self._locations[tail.lower()] = (tail, line)
             except Exception, msg:
-                print 'Error:_scan_bookmarks_files:', msg
+                LOGGER.exception(msg)
                 
 def filesystem_possible_completions(prefix, is_file=False):
     """
@@ -185,7 +186,7 @@
     # First if we have an exact file match, and we requested file matches we return it alone,
     # else, we return the empty file set
     if my_isfile(path):
-        print 'Myisfile:', is_file
+        LOGGER.debug("Myisfile: %s", is_file)
         if is_file:
             return ([path], dirname(prefix), relative)
         else:

Modified: trunk/deskbar/handlers/iswitch-window.py
==============================================================================
--- trunk/deskbar/handlers/iswitch-window.py	(original)
+++ trunk/deskbar/handlers/iswitch-window.py	Tue Apr  8 22:40:40 2008
@@ -2,8 +2,10 @@
 from gettext import gettext as _
 import deskbar.interfaces.Module, deskbar.interfaces.Match, deskbar.interfaces.Action, deskbar
 import gtk
+import logging
 import wnck
 
+LOGGER = logging.getLogger(__name__)
 HANDLERS = ["ISwitchWindowHandler"]
 
 class SwitchToWindowAction(deskbar.interfaces.Action):
@@ -22,10 +24,9 @@
         try:
             time = gtk.get_current_event().time
         except:
-            print "WARNING, iSwitchWindow : Using bogus timestamp."
+            LOGGER.warning("Using bogus timestamp.")
             time = gtk.get_current_event_time()
         
-        
         if hasattr(self._window.get_workspace(), 'activate') and self._window.get_workspace() != self._window.get_screen().get_active_workspace():
             self._window.get_workspace().activate(time)
 

Modified: trunk/deskbar/handlers/tomboy.py
==============================================================================
--- trunk/deskbar/handlers/tomboy.py	(original)
+++ trunk/deskbar/handlers/tomboy.py	Tue Apr  8 22:40:40 2008
@@ -180,7 +180,7 @@
                 LOGGER.exception(e)
                 return
     
-    def handle_dbus_error(self, e): print e
+    def handle_dbus_error(self, e): LOGGER.error(e)
     
     def query(self, text):
         if len(text) >= 3:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]