Mercurial > libervia-backend
comparison src/plugins/plugin_exp_parrot.py @ 594:e629371a28d3
Fix pep8 support in src/plugins.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 18 Jan 2013 17:55:35 +0100 |
parents | beaf6bec2fcd |
children | 6fd1095b2b7b |
comparison
equal
deleted
inserted
replaced
593:70bae685d05c | 594:e629371a28d3 |
---|---|
20 """ | 20 """ |
21 | 21 |
22 from logging import debug, info, warning, error | 22 from logging import debug, info, warning, error |
23 from twisted.words.protocols.jabber import jid | 23 from twisted.words.protocols.jabber import jid |
24 | 24 |
25 | |
26 from sat.core.exceptions import UnknownEntityError | 25 from sat.core.exceptions import UnknownEntityError |
27 from sat.tools.misc import SkipOtherTriggers | 26 from sat.tools.misc import SkipOtherTriggers |
28 | 27 |
29 PLUGIN_INFO = { | 28 PLUGIN_INFO = { |
30 "name": "Parrot Plugin", | 29 "name": "Parrot Plugin", |
31 "import_name": "EXP-PARROT", | 30 "import_name": "EXP-PARROT", |
32 "type": "EXP", | 31 "type": "EXP", |
33 "protocols": [], | 32 "protocols": [], |
34 "dependencies": ["XEP-0045"], | 33 "dependencies": ["XEP-0045"], |
35 "main": "Exp_Parrot", | 34 "main": "Exp_Parrot", |
36 "handler": "no", | 35 "handler": "no", |
37 "description": _("""Implementation of parrot mode (repeat messages between 2 entities)""") | 36 "description": _("""Implementation of parrot mode (repeat messages between 2 entities)""") |
38 } | 37 } |
38 | |
39 | 39 |
40 class Exp_Parrot(object): | 40 class Exp_Parrot(object): |
41 """Parrot mode plugin: repeat messages from one entity or MUC room to another one""" | 41 """Parrot mode plugin: repeat messages from one entity or MUC room to another one""" |
42 #XXX: This plugin can be potentially dangerous if we don't trust entities linked | 42 #XXX: This plugin can be potentially dangerous if we don't trust entities linked |
43 # this is specially true if we have other triggers. | 43 # this is specially true if we have other triggers. |
121 client = self.host.getClient(profile) | 121 client = self.host.getClient(profile) |
122 try: | 122 try: |
123 del client.parrot_links[source_jid.userhostJID()] | 123 del client.parrot_links[source_jid.userhostJID()] |
124 except (AttributeError, KeyError): | 124 except (AttributeError, KeyError): |
125 pass | 125 pass |
126 | |
127 |