finch/plugins/pietray.py

changeset 37985
c3bab3be9695
parent 37984
6a5ca046a90d
child 37987
81d3f45ae36b
--- a/finch/plugins/pietray.py	Thu Sep 01 23:58:47 2016 -0400
+++ b/finch/plugins/pietray.py	Fri Sep 02 00:45:59 2016 -0400
@@ -140,18 +140,20 @@
 
 
 def get_status_message():
+    status_names = {
+        1: 'Offline',
+        2: 'Available',
+        4: 'Invisible',
+        5: 'Away',
+    }
+
     status = purple.PurpleSavedstatusGetCurrent()
     msg = purple.PurpleSavedstatusGetMessage(status)
     if msg and len(msg) > 0:
         text = msg + " "
     else:
         text = ""
-    text = text + "(" + {
-        2: "Available",
-        5: "Away",
-        4: "Invisible",
-        1: "Offline"
-    }[purple.PurpleSavedstatusGetType(status)] + ")"
+    text += "(" + status_names[purple.PurpleSavedstatusGetType(status)] + ")"
     return text
 
 

mercurial