Fixed log_calls decorator arguments in a few plugins. Fixed Acronyms Expander plugin (not working due to bad auto-merge). Added few comments.
This commit is contained in:
parent
7b0a099feb
commit
6fecd84b16
5 changed files with 16 additions and 10 deletions
|
@ -718,6 +718,7 @@ Gajim core but uses new events handling system.'''
|
||||||
self.signal_object.remove_from_connection()
|
self.signal_object.remove_from_connection()
|
||||||
self.signal_object = None
|
self.signal_object = None
|
||||||
|
|
||||||
|
@log_calls('DBusPlugin')
|
||||||
def _set_handling_methods(self):
|
def _set_handling_methods(self):
|
||||||
for event_name in self.events_names:
|
for event_name in self.events_names:
|
||||||
setattr(self, event_name,
|
setattr(self, event_name,
|
||||||
|
|
|
@ -103,14 +103,15 @@ class EventsDumpPlugin(GajimPlugin):
|
||||||
self.events_handlers = {}
|
self.events_handlers = {}
|
||||||
self._set_handling_methods()
|
self._set_handling_methods()
|
||||||
|
|
||||||
@log_calls('DBusPlugin')
|
@log_calls('EventsDumpPlugin')
|
||||||
def activate(self):
|
def activate(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@log_calls('DBusPlugin')
|
@log_calls('EventsDumpPlugin')
|
||||||
def deactivate(self):
|
def deactivate(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@log_calls('EventsDumpPlugin')
|
||||||
def _set_handling_methods(self):
|
def _set_handling_methods(self):
|
||||||
for event_name in self.events_names:
|
for event_name in self.events_names:
|
||||||
setattr(self, event_name,
|
setattr(self, event_name,
|
||||||
|
|
|
@ -63,6 +63,7 @@ class GoogleTranslationPlugin(GajimPlugin):
|
||||||
self.translated_text_re = \
|
self.translated_text_re = \
|
||||||
re.compile(r'google.language.callbacks.id100\(\'22\',{"translatedText":"(?P<text>[^"]*)"}, 200, null, 200\)')
|
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):
|
def translate_text(self, text, from_lang, to_lang):
|
||||||
text = self.prepare_text_for_url(text)
|
text = self.prepare_text_for_url(text)
|
||||||
headers = { 'User-Agent' : self.config['user_agent'] }
|
headers = { 'User-Agent' : self.config['user_agent'] }
|
||||||
|
@ -76,6 +77,7 @@ class GoogleTranslationPlugin(GajimPlugin):
|
||||||
|
|
||||||
return translated_text
|
return translated_text
|
||||||
|
|
||||||
|
@log_calls('GoogleTranslationPlugin')
|
||||||
def prepare_text_for_url(self, text):
|
def prepare_text_for_url(self, text):
|
||||||
'''
|
'''
|
||||||
Converts text so it can be used within URL as query to Google Translate.
|
Converts text so it can be used within URL as query to Google Translate.
|
||||||
|
@ -90,11 +92,11 @@ class GoogleTranslationPlugin(GajimPlugin):
|
||||||
|
|
||||||
return text
|
return text
|
||||||
|
|
||||||
@log_calls('DBusPlugin')
|
@log_calls('GoogleTranslationPlugin')
|
||||||
def activate(self):
|
def activate(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@log_calls('DBusPlugin')
|
@log_calls('GoogleTranslationPlugin')
|
||||||
def deactivate(self):
|
def deactivate(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
@ -81,11 +81,11 @@ class NewEventsExamplePlugin(GajimPlugin):
|
||||||
#print "Event '%s' occured. Event object: %s\n\n===\n"%(event_object.name,
|
#print "Event '%s' occured. Event object: %s\n\n===\n"%(event_object.name,
|
||||||
#event_object
|
#event_object
|
||||||
|
|
||||||
@log_calls('DBusPlugin')
|
@log_calls('NewEventsExamplePlugin')
|
||||||
def activate(self):
|
def activate(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@log_calls('DBusPlugin')
|
@log_calls('NewEventsExamplePlugin')
|
||||||
def deactivate(self):
|
def deactivate(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -137,6 +137,7 @@ class EnrichedChatMessageReceivedEvent(nec.NetworkIncomingEvent):
|
||||||
self.from_jid = helpers.get_full_jid_from_iq(self.xmpp_msg)
|
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.from_jid_without_resource = gajim.get_jid_without_resource(self.from_jid)
|
||||||
self.account = unicode(self.xmpp_msg.attrs['to'])
|
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.from_nickname = gajim.get_contact_name_from_jid(
|
||||||
self.account,
|
self.account,
|
||||||
self.from_jid_without_resource)
|
self.from_jid_without_resource)
|
||||||
|
|
|
@ -292,6 +292,10 @@ class ChatControlBase(MessageControl):
|
||||||
|
|
||||||
self.smooth = True
|
self.smooth = True
|
||||||
self.msg_textview.grab_focus()
|
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):
|
def set_speller(self):
|
||||||
try:
|
try:
|
||||||
|
@ -334,10 +338,7 @@ class ChatControlBase(MessageControl):
|
||||||
menu.reorder_child(item, i)
|
menu.reorder_child(item, i)
|
||||||
i += 1
|
i += 1
|
||||||
menu.show_all()
|
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):
|
def shutdown(self):
|
||||||
# PluginSystem: removing GUI extension points connected with ChatControlBase
|
# PluginSystem: removing GUI extension points connected with ChatControlBase
|
||||||
|
|
Loading…
Add table
Reference in a new issue