PEP8 compilant
This commit is contained in:
@@ -7,7 +7,7 @@ description: This plugin integrates Gajim with the Ubuntu Messaging Menu.
|
||||
You must have python-indicate and python-xdg (and Gajim obviously) installed to enable this plugin.
|
||||
|
||||
Many thanks to the guys from gajim@conference.gajim.org for answering my questions :)
|
||||
authors: Michael Kainer <kaini@jabber.hot-chilli.net>
|
||||
authors: Michael Kainer <kaini@linuxlovers.at>
|
||||
homepage: http://trac-plugins.gajim.org/wiki/UbuntuIntegration
|
||||
|
||||
|
||||
|
||||
@@ -29,14 +29,15 @@ import gtkgui_helpers
|
||||
try:
|
||||
import indicate
|
||||
HAS_INDICATE = True
|
||||
except:
|
||||
except ImportError:
|
||||
HAS_INDICATE = False
|
||||
try:
|
||||
from xdg.BaseDirectory import load_data_paths
|
||||
HAS_PYXDG = True
|
||||
except:
|
||||
except ImportError:
|
||||
HAS_PYXDG = False
|
||||
|
||||
|
||||
class UbuntuIntegrationPlugin(GajimPlugin):
|
||||
"""
|
||||
Class for Messaging Menu and Me Menu.
|
||||
@@ -132,17 +133,17 @@ class UbuntuIntegrationPlugin(GajimPlugin):
|
||||
elif event.type_ == "printed_marked_gc_msg":
|
||||
contact = gajim.get_nick_from_jid(gajim.get_room_from_fjid(jid))
|
||||
else:
|
||||
print "ignored";
|
||||
print "ignored"
|
||||
return
|
||||
|
||||
print account, jid, when, contact
|
||||
|
||||
# Add a new indicator if necessary
|
||||
if not self.events.has_key(key):
|
||||
if key not in self.events:
|
||||
indicator = indicate.Indicator()
|
||||
indicator.set_property("name", contact)
|
||||
indicator.set_property_time("time", when)
|
||||
indicator.set_property_bool("draw-attention", True);
|
||||
indicator.set_property_bool("draw-attention", True)
|
||||
if gajim.config.get("show_avatars_in_roster"):
|
||||
pixbuf = gtkgui_helpers.get_avatar_pixbuf_from_cache(jid)
|
||||
if pixbuf not in (None, "ask"):
|
||||
@@ -154,7 +155,7 @@ class UbuntuIntegrationPlugin(GajimPlugin):
|
||||
|
||||
# Prepare the event and save it
|
||||
event.time = when
|
||||
self.events[key][1].append(event);
|
||||
self.events[key][1].append(event)
|
||||
|
||||
def on_event_removed(self, events):
|
||||
"""
|
||||
@@ -166,7 +167,7 @@ class UbuntuIntegrationPlugin(GajimPlugin):
|
||||
|
||||
key = (event.account, event.jid)
|
||||
|
||||
if self.events.has_key(key) and \
|
||||
if key not in self.events and \
|
||||
event in self.events[key][1]:
|
||||
self.events[key][1].remove(event)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user