[hamster-applet] removed globals and using the standart availability pattern



commit cec8b4e45b81e3bd5ea37626746749648886f9b1
Author: Toms Bauģis <toms baugis gmail com>
Date:   Tue Jan 19 13:02:04 2010 +0000

    removed globals and using the standart availability pattern

 hamster/applet.py |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/hamster/applet.py b/hamster/applet.py
index 1b1b453..011fee1 100755
--- a/hamster/applet.py
+++ b/hamster/applet.py
@@ -45,18 +45,16 @@ import pango
 
 try:
     import wnck
-    WNCK = True
 except:
     logging.warning("Could not import wnck - workspace tracking will be disabled")
-    WNCK = False
+    wnck = None
 
 try:
     import pynotify
-    PYNOTIFY = True
     pynotify.init('Hamster Applet')
 except:
     logging.warning("Could not import pynotify - notifications will be disabled")
-    PYNOTIFY = False
+    pynotify = None
 
 class PanelButton(gtk.ToggleButton):
     def __init__(self):
@@ -269,7 +267,7 @@ class HamsterApplet(object):
             self.init_workspace_tracking()
 
         self.notification = None
-        if PYNOTIFY:
+        if pynotify:
             self.notification = pynotify.Notification("Oh hi",
                                                       "Greetings from hamster!")
             self.notification.set_urgency(pynotify.URGENCY_LOW) # lower than grass
@@ -280,7 +278,7 @@ class HamsterApplet(object):
 
 
     def init_workspace_tracking(self):
-        if not WNCK: # can't track if we don't have the trackable
+        if not wnck: # can't track if we don't have the trackable
             return
 
         self.screen = wnck.screen_get_default()



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