Fix pep8 support in src/plugins.
This commit is contained in:
parent
e51a8a650b
commit
0dca274360
1 changed files with 1052 additions and 1079 deletions
|
|
@ -35,15 +35,16 @@ from wokkel import disco, iwokkel, data_form
|
|||
NS_FEATURE_NEG = 'http://jabber.org/protocol/feature-neg'
|
||||
|
||||
PLUGIN_INFO = {
|
||||
"name": "XEP 0020 Plugin",
|
||||
"import_name": "XEP-0020",
|
||||
"type": "XEP",
|
||||
"protocols": ["XEP-0020"],
|
||||
"main": "XEP_0020",
|
||||
"handler": "yes",
|
||||
"description": _("""Implementation of Feature Negotiation""")
|
||||
"name": "XEP 0020 Plugin",
|
||||
"import_name": "XEP-0020",
|
||||
"type": "XEP",
|
||||
"protocols": ["XEP-0020"],
|
||||
"main": "XEP_0020",
|
||||
"handler": "yes",
|
||||
"description": _("""Implementation of Feature Negotiation""")
|
||||
}
|
||||
|
||||
|
||||
class XEP_0020(object):
|
||||
|
||||
def __init__(self, host):
|
||||
|
|
@ -67,7 +68,7 @@ class XEP_0020(object):
|
|||
for field in form.fields:
|
||||
values = form.fields[field].values
|
||||
result[field] = values[0] if values else None
|
||||
if len(values)>1:
|
||||
if len(values) > 1:
|
||||
warning(_("More than one value choosed for %s, keeping the first one") % field)
|
||||
return result
|
||||
|
||||
|
|
@ -92,7 +93,7 @@ class XEP_0020(object):
|
|||
feature_elt.addChild(x_form.toElement())
|
||||
return feature_elt
|
||||
|
||||
def proposeFeatures(self, options_dict, namespace = None):
|
||||
def proposeFeatures(self, options_dict, namespace=None):
|
||||
"""Build a feature element with options to propose
|
||||
@param options_dict: dict with feature as key and list of acceptable options as value
|
||||
@param namespace: feature namespace"""
|
||||
|
|
@ -104,6 +105,7 @@ class XEP_0020(object):
|
|||
feature_elt.addChild(x_form.toElement())
|
||||
return feature_elt
|
||||
|
||||
|
||||
class XEP_0020_handler(XMPPHandler):
|
||||
implements(iwokkel.IDisco)
|
||||
|
||||
|
|
@ -112,4 +114,3 @@ class XEP_0020_handler(XMPPHandler):
|
|||
|
||||
def getDiscoItems(self, requestor, target, nodeIdentifier=''):
|
||||
return []
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue