Commit 9b5ee1e1 authored by Éric Araujo's avatar Éric Araujo

convert tabs to spaces in source code thanks to reindent.py

Also use sed to remove now unneeded Vim lines, 2to3 -f ws_comma to fix
some whitespace, and fix some other madness manually.
parent 57cd53ae
# coding=utf-8
emoticons = {
'smile.png': [':-)', ':)'],
'coolglasses.png': ['B-)', '(H)'],
'wink.gif': [';-)', ';)'],
'biggrin.png': [':-D', ':D'],
'unhappy.png': [':-(', ':('],
'cry.gif': [":'-(", ":'(", ';-(', ';(', ";'-("],
'frowning.png': [':-/', ':/', ':-\\', ':\\', ':-S', ':S'],
'blush.png': [':-$', ':$'],
'angry.png': [':-@', ':@'],
'bat.gif': [':-[', ':['],
'kiss.png': [':-{}', ':-*', ':*', '(K)'],
'stare.png': [':-|', ':|'],
'devil.png': [']:->', '>:-)', '>:)', '(6)'],
'tongue.png': [':-P', ':P', ':-þ', ':þ'],
'oh.png': ['=-O', ':-O', ':O'],
'heart.png': ['<3', '(L)', '*IN LOVE*'],
'pussy.png': ['(@)'],
'cuffs.png': ['(%)'],
'moon.png': ['(S)'],
'lamp.png': ['(I)'],
'music.png': ['(8)'],
'beer.png': ['(B)', '*DRINK*'],
'brflower.png': ['(W)'],
'boy.png': ['(Z)'],
'girl.png': ['(X)'],
'mail.png': ['(E)'],
'thumbdown.png': ['(N)'],
'photo.png': ['(P)'],
'thumbup.png': ['(Y)', '*THUMBS UP*'],
'hugleft.png': ['(})'],
'brheart.png': ['</3', '(U)'],
'flower.png': ['@}->--', '(F)'],
'drink.png': ['(D)'],
'phone.png': ['(T)'],
'coffee.png': ['(C)'],
'hugright.png': ['({)'],
'star.png': ['(*)'],
'rainbow.png': ['(R)'],
'cigarette.gif': ['(ci)'],
'cake.gif': ['(^)'],
'dontknow.gif': [':^)'],
'eyeroll.gif': ['8-)'],
'lightning.gif': ['(li)'],
'party.gif': ['<:o)'],
'sleepy.gif': ['|-)'],
'think.gif': ['*-)'],
'puke.gif': [':-!'],
'smile.png': [':-)', ':)'],
'coolglasses.png': ['B-)', '(H)'],
'wink.gif': [';-)', ';)'],
'biggrin.png': [':-D', ':D'],
'unhappy.png': [':-(', ':('],
'cry.gif': [":'-(", ":'(", ';-(', ';(', ";'-("],
'frowning.png': [':-/', ':/', ':-\\', ':\\', ':-S', ':S'],
'blush.png': [':-$', ':$'],
'angry.png': [':-@', ':@'],
'bat.gif': [':-[', ':['],
'kiss.png': [':-{}', ':-*', ':*', '(K)'],
'stare.png': [':-|', ':|'],
'devil.png': [']:->', '>:-)', '>:)', '(6)'],
'tongue.png': [':-P', ':P', ':-þ', ':þ'],
'oh.png': ['=-O', ':-O', ':O'],
'heart.png': ['<3', '(L)', '*IN LOVE*'],
'pussy.png': ['(@)'],
'cuffs.png': ['(%)'],
'moon.png': ['(S)'],
'lamp.png': ['(I)'],
'music.png': ['(8)'],
'beer.png': ['(B)', '*DRINK*'],
'brflower.png': ['(W)'],
'boy.png': ['(Z)'],
'girl.png': ['(X)'],
'mail.png': ['(E)'],
'thumbdown.png': ['(N)'],
'photo.png': ['(P)'],
'thumbup.png': ['(Y)', '*THUMBS UP*'],
'hugleft.png': ['(})'],
'brheart.png': ['</3', '(U)'],
'flower.png': ['@}->--', '(F)'],
'drink.png': ['(D)'],
'phone.png': ['(T)'],
'coffee.png': ['(C)'],
'hugright.png': ['({)'],
'star.png': ['(*)'],
'rainbow.png': ['(R)'],
'cigarette.gif': ['(ci)'],
'cake.gif': ['(^)'],
'dontknow.gif': [':^)'],
'eyeroll.gif': ['8-)'],
'lightning.gif': ['(li)'],
'party.gif': ['<:o)'],
'sleepy.gif': ['|-)'],
'think.gif': ['*-)'],
'puke.gif': [':-!'],
}
# vim: se ts=3:
# coding=utf-8
emoticons = {
'smile.png': [':-)', ':)'],
'coolglasses.png': ['8-)', 'B-)', '(H)'],
'wink.png': [';-)', ';)'],
'biggrin.png': [':-D', ':D'],
'unhappy.png': [':-(', ':('],
'cry.png': [":'-(", ":'(", ';-(', ';(', ";'-("],
'frowning.png': [':-/', ':/', ':-\\', ':\\', ':-S', ':S'],
'blush.png': [':-$', ':$'],
'angry.png': [':-@', ':@'],
'bat.png': [':-[', ':['],
'kiss.png': [':-{}', ':-*', ':*', '(K)'],
'stare.png': [':-|', ':|'],
'devil.png': [']:->', '>:-)', '>:)', '(6)'],
'tongue.png': [':-P', ':P', ':-þ', ':þ'],
'oh.png': ['=-O', ':-O', ':O'],
'heart.png': ['<3', '(L)', '*IN LOVE*'],
'lion.png': [':3', '>:3'],
'pussy.png': ['(@)', '=^.^='],
'cuffs.png': ['(%)'],
'moon.png': ['(S)'],
'lamp.png': ['(I)'],
'music.png': ['(8)'],
'beer.png': ['(B)', '*DRINK*'],
'brflower.png': ['(W)'],
'boy.png': ['(Z)'],
'girl.png': ['(X)'],
'mail.png': ['(E)'],
'thumbdown.png': ['(N)'],
'photo.png': ['(P)'],
'thumbup.png': ['(Y)', '*THUMBS UP*'],
'hugleft.png': ['(})'],
'brheart.png': ['</3', '(U)'],
'flower.png': ['@}->--', '(F)'],
'drink.png': ['(D)'],
'phone.png': ['(T)'],
'coffee.png': ['(C)'],
'hugright.png': ['({)'],
'star.png': ['(*)'],
'rainbow.png': ['(R)'],
'puke.png': [':-!'],
'smile.png': [':-)', ':)'],
'coolglasses.png': ['8-)', 'B-)', '(H)'],
'wink.png': [';-)', ';)'],
'biggrin.png': [':-D', ':D'],
'unhappy.png': [':-(', ':('],
'cry.png': [":'-(", ":'(", ';-(', ';(', ";'-("],
'frowning.png': [':-/', ':/', ':-\\', ':\\', ':-S', ':S'],
'blush.png': [':-$', ':$'],
'angry.png': [':-@', ':@'],
'bat.png': [':-[', ':['],
'kiss.png': [':-{}', ':-*', ':*', '(K)'],
'stare.png': [':-|', ':|'],
'devil.png': [']:->', '>:-)', '>:)', '(6)'],
'tongue.png': [':-P', ':P', ':-þ', ':þ'],
'oh.png': ['=-O', ':-O', ':O'],
'heart.png': ['<3', '(L)', '*IN LOVE*'],
'lion.png': [':3', '>:3'],
'pussy.png': ['(@)', '=^.^='],
'cuffs.png': ['(%)'],
'moon.png': ['(S)'],
'lamp.png': ['(I)'],
'music.png': ['(8)'],
'beer.png': ['(B)', '*DRINK*'],
'brflower.png': ['(W)'],
'boy.png': ['(Z)'],
'girl.png': ['(X)'],
'mail.png': ['(E)'],
'thumbdown.png': ['(N)'],
'photo.png': ['(P)'],
'thumbup.png': ['(Y)', '*THUMBS UP*'],
'hugleft.png': ['(})'],
'brheart.png': ['</3', '(U)'],
'flower.png': ['@}->--', '(F)'],
'drink.png': ['(D)'],
'phone.png': ['(T)'],
'coffee.png': ['(C)'],
'hugright.png': ['({)'],
'star.png': ['(*)'],
'rainbow.png': ['(R)'],
'puke.png': [':-!'],
}
# vim: se ts=3:
# coding=utf-8
emoticons = {
'smile.png': [':-)', ':)'],
'coolglasses.png': ['8-)', 'B-)', '(H)'],
'wink.png': [';-)', ';)'],
'biggrin.png': [':-D', ':D'],
'unhappy.png': [':-(', ':('],
'cry.png': [":'-(", ":'(", ';-(', ';(', ";'-("],
'frowning.png': [':-/', ':/', ':-\\', ':\\', ':-S', ':S'],
'blush.png': [':-$', ':$'],
'angry.png': [':-@', ':@'],
'bat.png': [':-[', ':['],
'kiss.png': [':-{}', ':-*', ':*', '(K)'],
'stare.png': [':-|', ':|'],
'devil.png': [']:->', '>:-)', '>:)', '(6)'],
'tongue.png': [':-P', ':P', ':-þ', ':þ'],
'oh.png': ['=-O', ':-O', ':O'],
'heart.png': ['<3', '(L)', '*IN LOVE*'],
'lion.png': [':3', '>:3'],
'pussy.png': ['(@)', '=^.^='],
'cuffs.png': ['(%)'],
'moon.png': ['(S)'],
'lamp.png': ['(I)'],
'music.png': ['(8)'],
'beer.png': ['(B)', '*DRINK*'],
'brflower.png': ['(W)'],
'boy.png': ['(Z)'],
'girl.png': ['(X)'],
'mail.png': ['(E)'],
'thumbdown.png': ['(N)'],
'photo.png': ['(P)'],
'thumbup.png': ['(Y)', '*THUMBS UP*'],
'hugleft.png': ['(})'],
'brheart.png': ['</3', '(U)'],
'flower.png': ['@}->--', '(F)'],
'drink.png': ['(D)'],
'phone.png': ['(T)'],
'coffee.png': ['(C)'],
'hugright.png': ['({)'],
'star.png': ['(*)'],
'rainbow.png': ['(R)'],
'puke.png': [':-!'],
'smile.png': [':-)', ':)'],
'coolglasses.png': ['8-)', 'B-)', '(H)'],
'wink.png': [';-)', ';)'],
'biggrin.png': [':-D', ':D'],
'unhappy.png': [':-(', ':('],
'cry.png': [":'-(", ":'(", ';-(', ';(', ";'-("],
'frowning.png': [':-/', ':/', ':-\\', ':\\', ':-S', ':S'],
'blush.png': [':-$', ':$'],
'angry.png': [':-@', ':@'],
'bat.png': [':-[', ':['],
'kiss.png': [':-{}', ':-*', ':*', '(K)'],
'stare.png': [':-|', ':|'],
'devil.png': [']:->', '>:-)', '>:)', '(6)'],
'tongue.png': [':-P', ':P', ':-þ', ':þ'],
'oh.png': ['=-O', ':-O', ':O'],
'heart.png': ['<3', '(L)', '*IN LOVE*'],
'lion.png': [':3', '>:3'],
'pussy.png': ['(@)', '=^.^='],
'cuffs.png': ['(%)'],
'moon.png': ['(S)'],
'lamp.png': ['(I)'],
'music.png': ['(8)'],
'beer.png': ['(B)', '*DRINK*'],
'brflower.png': ['(W)'],
'boy.png': ['(Z)'],
'girl.png': ['(X)'],
'mail.png': ['(E)'],
'thumbdown.png': ['(N)'],
'photo.png': ['(P)'],
'thumbup.png': ['(Y)', '*THUMBS UP*'],
'hugleft.png': ['(})'],
'brheart.png': ['</3', '(U)'],
'flower.png': ['@}->--', '(F)'],
'drink.png': ['(D)'],
'phone.png': ['(T)'],
'coffee.png': ['(C)'],
'hugright.png': ['({)'],
'star.png': ['(*)'],
'rainbow.png': ['(R)'],
'puke.png': [':-!'],
}
# vim: se ts=3:
......@@ -49,4 +49,4 @@ emoticons = {
'pissed-off.png': ['*WALL*'],
'mail.png': ['*WRITE*', '(E)'],
'tremble.png': ['*SCRATCH*'],
}
\ No newline at end of file
}
......@@ -33,69 +33,70 @@ from plugins import GajimPlugin
from plugins.helpers import log, log_calls
class AcronymsExpanderPlugin(GajimPlugin):
name = u'Acronyms Expander'
short_name = u'acronyms_expander'
version = u'0.1'
description = u'''Replaces acronyms (or other strings) with given expansions/substitutes.'''
authors = [u'Mateusz Biliński <mateusz@bilinski.it>']
homepage = u'http://blog.bilinski.it'
@log_calls('AcronymsExpanderPlugin')
def init(self):
self.config_dialog = None
self.gui_extension_points = {
'chat_control_base' : (self.connect_with_chat_control_base,
self.disconnect_from_chat_control_base)
}
name = u'Acronyms Expander'
short_name = u'acronyms_expander'
version = u'0.1'
description = u'''Replaces acronyms (or other strings) with given expansions/substitutes.'''
authors = [u'Mateusz Biliński <mateusz@bilinski.it>']
homepage = u'http://blog.bilinski.it'
self.config_default_values = {'INVOKER' : (' ', _('')),
'ACRONYMS' : ({'RTFM' : 'Read The Friendly Manual',
'/slap' : '/me slaps',
'PS-' : 'plug-in system',
'G-' : 'Gajim',
'GNT-' : 'http://trac.gajim.org/newticket',
'GW-' : 'http://trac.gajim.org/',
'GTS-' : 'http://trac.gajim.org/report'
}, _('')),
}
@log_calls('AcronymsExpanderPlugin')
def init(self):
self.config_dialog = None
@log_calls('AcronymsExpanderPlugin')
def textbuffer_live_acronym_expander(self, tb):
"""
@param tb gtk.TextBuffer
"""
#assert isinstance(tb,gtk.TextBuffer)
ACRONYMS = self.config['ACRONYMS']
INVOKER = self.config['INVOKER']
t = tb.get_text(tb.get_start_iter(), tb.get_end_iter())
#log.debug('%s %d'%(t, len(t)))
if t and t[-1] == INVOKER:
#log.debug('changing msg text')
base,sep,head=t[:-1].rpartition(INVOKER)
log.debug('%s | %s | %s'%(base, sep, head))
if head in ACRONYMS:
head = ACRONYMS[head]
#log.debug('head: %s'%(head))
t = ''.join((base, sep, head, INVOKER))
#log.debug("setting text: '%s'"%(t))
gobject.idle_add(tb.set_text, t)
@log_calls('AcronymsExpanderPlugin')
def connect_with_chat_control_base(self, chat_control):
d = {}
tv = chat_control.msg_textview
tb = tv.get_buffer()
h_id = tb.connect('changed', self.textbuffer_live_acronym_expander)
d['h_id'] = h_id
self.gui_extension_points = {
'chat_control_base': (self.connect_with_chat_control_base,
self.disconnect_from_chat_control_base)
}
chat_control.acronyms_expander_plugin_data = d
self.config_default_values = {
'INVOKER': (' ', _('')),
'ACRONYMS': ({'RTFM': 'Read The Friendly Manual',
'/slap': '/me slaps',
'PS-': 'plug-in system',
'G-': 'Gajim',
'GNT-': 'http://trac.gajim.org/newticket',
'GW-': 'http://trac.gajim.org/',
'GTS-': 'http://trac.gajim.org/report',
},
_('')),
}
return True
@log_calls('AcronymsExpanderPlugin')
def textbuffer_live_acronym_expander(self, tb):
"""
@param tb gtk.TextBuffer
"""
#assert isinstance(tb,gtk.TextBuffer)
ACRONYMS = self.config['ACRONYMS']
INVOKER = self.config['INVOKER']
t = tb.get_text(tb.get_start_iter(), tb.get_end_iter())
#log.debug('%s %d'%(t, len(t)))
if t and t[-1] == INVOKER:
#log.debug('changing msg text')
base, sep, head=t[:-1].rpartition(INVOKER)
log.debug('%s | %s | %s'%(base, sep, head))
if head in ACRONYMS:
head = ACRONYMS[head]
#log.debug('head: %s'%(head))
t = ''.join((base, sep, head, INVOKER))
#log.debug("setting text: '%s'"%(t))
gobject.idle_add(tb.set_text, t)
@log_calls('AcronymsExpanderPlugin')
def disconnect_from_chat_control_base(self, chat_control):
d = chat_control.acronyms_expander_plugin_data
tv = chat_control.msg_textview
tv.get_buffer().disconnect(d['h_id'])
@log_calls('AcronymsExpanderPlugin')
def connect_with_chat_control_base(self, chat_control):
d = {}
tv = chat_control.msg_textview
tb = tv.get_buffer()
h_id = tb.connect('changed', self.textbuffer_live_acronym_expander)
d['h_id'] = h_id
chat_control.acronyms_expander_plugin_data = d
return True
@log_calls('AcronymsExpanderPlugin')
def disconnect_from_chat_control_base(self, chat_control):
d = chat_control.acronyms_expander_plugin_data
tv = chat_control.msg_textview
tv.get_buffer().disconnect(d['h_id'])
from plugin import BannerTweaksPlugin
\ No newline at end of file
from plugin import BannerTweaksPlugin
This diff is collapsed.
from plugin import DBusPlugin
\ No newline at end of file
from plugin import DBusPlugin
This diff is collapsed.
from plugin import EventsDumpPlugin
\ No newline at end of file
from plugin import EventsDumpPlugin
......@@ -17,7 +17,7 @@
'''
Events Dump plugin.
Dumps info about selected events to console.
Dumps info about selected events to console.
:author: Mateusz Biliński <mateusz@bilinski.it>
:since: 10th August 2008
......@@ -33,97 +33,97 @@ from plugins.helpers import log_calls, log
from common import ged
class EventsDumpPlugin(GajimPlugin):
name = u'Events Dump'
short_name = u'events_dump'
version = u'0.1'
description = u'''Dumps info about selected events to console.'''
authors = [u'Mateusz Biliński <mateusz@bilinski.it>']
homepage = u'http://blog.bilinski.it'
@log_calls('EventsDumpPlugin')
def init(self):
self.config_dialog = None
#self.gui_extension_points = {}
#self.config_default_values = {}
events_from_old_dbus_support = [
'Roster', 'AccountPresence', 'ContactPresence',
'ContactAbsence', 'ContactStatus', 'NewMessage',
'Subscribe', 'Subscribed', 'Unsubscribed',
'NewAccount', 'VcardInfo', 'LastStatusTime',
'OsInfo', 'GCPresence', 'GCMessage', 'RosterInfo',
'NewGmail']
events_from_src_gajim = [
'ROSTER', 'WARNING', 'ERROR',
'INFORMATION', 'ERROR_ANSWER', 'STATUS',
'NOTIFY', 'MSGERROR', 'MSGSENT', 'MSGNOTSENT',
'SUBSCRIBED', 'UNSUBSCRIBED', 'SUBSCRIBE',
'AGENT_ERROR_INFO', 'AGENT_ERROR_ITEMS',
'AGENT_REMOVED', 'REGISTER_AGENT_INFO',
'AGENT_INFO_ITEMS', 'AGENT_INFO_INFO',
'QUIT', 'NEW_ACC_CONNECTED',
'NEW_ACC_NOT_CONNECTED', 'ACC_OK', 'ACC_NOT_OK',
'MYVCARD', 'VCARD', 'LAST_STATUS_TIME', 'OS_INFO',
'GC_NOTIFY', 'GC_MSG', 'GC_SUBJECT', 'GC_CONFIG',
'GC_CONFIG_CHANGE', 'GC_INVITATION',
'GC_AFFILIATION', 'GC_PASSWORD_REQUIRED',
'BAD_PASSPHRASE', 'ROSTER_INFO', 'BOOKMARKS',
'CON_TYPE', 'CONNECTION_LOST', 'FILE_REQUEST',
'GMAIL_NOTIFY', 'FILE_REQUEST_ERROR',
'FILE_SEND_ERROR', 'STANZA_ARRIVED', 'STANZA_SENT',
'HTTP_AUTH', 'VCARD_PUBLISHED',
'VCARD_NOT_PUBLISHED', 'ASK_NEW_NICK', 'SIGNED_IN',
'METACONTACTS', 'ATOM_ENTRY', 'FAILED_DECRYPT',
'PRIVACY_LISTS_RECEIVED', 'PRIVACY_LIST_RECEIVED',
'PRIVACY_LISTS_ACTIVE_DEFAULT',
'PRIVACY_LIST_REMOVED', 'ZC_NAME_CONFLICT',
'PING_SENT', 'PING_REPLY', 'PING_ERROR',
'SEARCH_FORM', 'SEARCH_RESULT',
'RESOURCE_CONFLICT', 'PEP_CONFIG',
'UNIQUE_ROOM_ID_UNSUPPORTED',
'UNIQUE_ROOM_ID_SUPPORTED', 'SESSION_NEG',
'GPG_PASSWORD_REQUIRED', 'SSL_ERROR',
'FINGERPRINT_ERROR', 'PLAIN_CONNECTION',
'PUBSUB_NODE_REMOVED', 'PUBSUB_NODE_NOT_REMOVED']
network_events_from_core = ['raw-message-received',
'raw-iq-received',
'raw-pres-received']
network_events_generated_in_nec = [
'customized-message-received',
'more-customized-message-received',
'modify-only-message-received',
'enriched-chat-message-received']
self.events_names = []
self.events_names += network_events_from_core
self.events_names += network_events_generated_in_nec
self.events_handlers = {}
self._set_handling_methods()
@log_calls('EventsDumpPlugin')
def activate(self):
pass
@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,
new.instancemethod(
self._generate_handling_method(event_name),
self,
EventsDumpPlugin))
self.events_handlers[event_name] = (ged.POSTCORE,
getattr(self, event_name))
def _generate_handling_method(self, event_name):
def handler(self, *args):
print "Event '%s' occured. Arguments: %s\n\n===\n"%(event_name, pformat(args))
return handler
\ No newline at end of file
name = u'Events Dump'
short_name = u'events_dump'
version = u'0.1'
description = u'''Dumps info about selected events to console.'''
authors = [u'Mateusz Biliński <mateusz@bilinski.it>']
homepage = u'http://blog.bilinski.it'
@log_calls('EventsDumpPlugin')
def init(self):
self.config_dialog = None
#self.gui_extension_points = {}
#self.config_default_values = {}
events_from_old_dbus_support = [
'Roster', 'AccountPresence', 'ContactPresence',
'ContactAbsence', 'ContactStatus', 'NewMessage',
'Subscribe', 'Subscribed', 'Unsubscribed',
'NewAccount', 'VcardInfo', 'LastStatusTime',
'OsInfo', 'GCPresence', 'GCMessage', 'RosterInfo',
'NewGmail']
events_from_src_gajim = [
'ROSTER', 'WARNING', 'ERROR',
'INFORMATION', 'ERROR_ANSWER', 'STATUS',
'NOTIFY', 'MSGERROR', 'MSGSENT', 'MSGNOTSENT',
'SUBSCRIBED', 'UNSUBSCRIBED', 'SUBSCRIBE',
'AGENT_ERROR_INFO', 'AGENT_ERROR_ITEMS',
'AGENT_REMOVED', 'REGISTER_AGENT_INFO',
'AGENT_INFO_ITEMS', 'AGENT_INFO_INFO',
'QUIT', 'NEW_ACC_CONNECTED',
'NEW_ACC_NOT_CONNECTED', 'ACC_OK', 'ACC_NOT_OK',
'MYVCARD', 'VCARD', 'LAST_STATUS_TIME', 'OS_INFO',
'GC_NOTIFY', 'GC_MSG', 'GC_SUBJECT', 'GC_CONFIG',
'GC_CONFIG_CHANGE', 'GC_INVITATION',
'GC_AFFILIATION', 'GC_PASSWORD_REQUIRED',
'BAD_PASSPHRASE', 'ROSTER_INFO', 'BOOKMARKS',
'CON_TYPE', 'CONNECTION_LOST', 'FILE_REQUEST',
'GMAIL_NOTIFY', 'FILE_REQUEST_ERROR',
'FILE_SEND_ERROR', 'STANZA_ARRIVED', 'STANZA_SENT',
'HTTP_AUTH', 'VCARD_PUBLISHED',
'VCARD_NOT_PUBLISHED', 'ASK_NEW_NICK', 'SIGNED_IN',
'METACONTACTS', 'ATOM_ENTRY', 'FAILED_DECRYPT',
'PRIVACY_LISTS_RECEIVED', 'PRIVACY_LIST_RECEIVED',
'PRIVACY_LISTS_ACTIVE_DEFAULT',
'PRIVACY_LIST_REMOVED', 'ZC_NAME_CONFLICT',
'PING_SENT', 'PING_REPLY', 'PING_ERROR',
'SEARCH_FORM', 'SEARCH_RESULT',
'RESOURCE_CONFLICT', 'PEP_CONFIG',
'UNIQUE_ROOM_ID_UNSUPPORTED',
'UNIQUE_ROOM_ID_SUPPORTED', 'SESSION_NEG',
'GPG_PASSWORD_REQUIRED', 'SSL_ERROR',
'FINGERPRINT_ERROR', 'PLAIN_CONNECTION',
'PUBSUB_NODE_REMOVED', 'PUBSUB_NODE_NOT_REMOVED']
network_events_from_core = ['raw-message-received',
'raw-iq-received',
'raw-pres-received']
network_events_generated_in_nec = [
'customized-message-received',
'more-customized-message-received',
'modify-only-message-received',
'enriched-chat-message-received']
self.events_names = []
self.events_names += network_events_from_core
self.events_names += network_events_generated_in_nec
self.events_handlers = {}
self._set_handling_methods()
@log_calls('EventsDumpPlugin')
def activate(self):
pass
@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,
new.instancemethod(
self._generate_handling_method(event_name),
self,
EventsDumpPlugin))
self.events_handlers[event_name] = (ged.POSTCORE,
getattr(self, event_name))
def _generate_handling_method(self, event_name):
def handler(self, *args):
print "Event '%s' occured. Arguments: %s\n\n===\n"%(event_name, pformat(args))
return handler
from plugin import GoogleTranslationPlugin
\ No newline at end of file
from plugin import GoogleTranslationPlugin