Commit 6fecd84b authored by Mateusz Biliński's avatar Mateusz Biliński

Fixed log_calls decorator arguments in a few plugins. Fixed Acronyms Expander...

Fixed log_calls decorator arguments in a few plugins. Fixed Acronyms Expander plugin (not working due to bad auto-merge). Added few comments.
parent 7b0a099f
......@@ -718,6 +718,7 @@ Gajim core but uses new events handling system.'''
self.signal_object.remove_from_connection()
self.signal_object = None
@log_calls('DBusPlugin')
def _set_handling_methods(self):
for event_name in self.events_names:
setattr(self, event_name,
......
......@@ -103,14 +103,15 @@ class EventsDumpPlugin(GajimPlugin):
self.events_handlers = {}
self._set_handling_methods()
@log_calls('DBusPlugin')
@log_calls('EventsDumpPlugin')
def activate(self):
pass
@log_calls('DBusPlugin')
@log_calls('EventsDumpPlugin')
def deactivate(self):
pass
@log_calls('EventsDumpPlugin')
def _set_handling_methods(self):
for event_name in self.events_names:
setattr(self, event_name,
......
......@@ -63,6 +63,7 @@ class GoogleTranslationPlugin(GajimPlugin):
self.translated_text_re = \
re.compile(r'google.language.callbacks.id100\(\'22\',{"translatedText":"(?P<text>[^"]*)"}, 200, null, 200\)')
@log_calls('GoogleTranslationPlugin')
def translate_text(self, text, from_lang, to_lang):
text = self.prepare_text_for_url(text)
headers = { 'User-Agent' : self.config['user_agent'] }
......@@ -76,6 +77,7 @@ class GoogleTranslationPlugin(GajimPlugin):
return translated_text
@log_calls('GoogleTranslationPlugin')
def prepare_text_for_url(self, text):
'''
Converts text so it can be used within URL as query to Google Translate.
......@@ -90,11 +92,11 @@ class GoogleTranslationPlugin(GajimPlugin):
return text
@log_calls('DBusPlugin')
@log_calls('GoogleTranslationPlugin')
def activate(self):
pass
@log_calls('DBusPlugin')
@log_calls('GoogleTranslationPlugin')
def deactivate(self):
pass
......
......@@ -81,11 +81,11 @@ class NewEventsExamplePlugin(GajimPlugin):
#print "Event '%s' occured. Event object: %s\n\n===\n"%(event_object.name,
#event_object
@log_calls('DBusPlugin')
@log_calls('NewEventsExamplePlugin')
def activate(self):
pass
@log_calls('DBusPlugin')
@log_calls('NewEventsExamplePlugin')
def deactivate(self):
pass
......@@ -137,6 +137,7 @@ class EnrichedChatMessageReceivedEvent(nec.NetworkIncomingEvent):
self.from_jid = helpers.get_full_jid_from_iq(self.xmpp_msg)
self.from_jid_without_resource = gajim.get_jid_without_resource(self.from_jid)
self.account = unicode(self.xmpp_msg.attrs['to'])
# FIXME: KeyError: u'vardo@jabber.org/Gajim'
self.from_nickname = gajim.get_contact_name_from_jid(
self.account,
self.from_jid_without_resource)
......
......@@ -292,6 +292,10 @@ class ChatControlBase(MessageControl):
self.smooth = True
self.msg_textview.grab_focus()
# PluginSystem: adding GUI extension point for ChatControlBase
# instance object (also subclasses, eg. ChatControl or GroupchatControl)
gajim.plugin_manager.gui_extension_point('chat_control_base', self)
def set_speller(self):
try:
......@@ -334,10 +338,7 @@ class ChatControlBase(MessageControl):
menu.reorder_child(item, i)
i += 1
menu.show_all()
# PluginSystem: adding GUI extension point for ChatControlBase
# instance object (also subclasses, eg. ChatControl or GroupchatControl)
gajim.plugin_manager.gui_extension_point('chat_control_base', self)
def shutdown(self):
# PluginSystem: removing GUI extension points connected with ChatControlBase
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment