code style reformatting using black
This commit is contained in:
parent
4127bcffd0
commit
744cb0c503
1 changed files with 21394 additions and 10488 deletions
|
|
@ -20,12 +20,12 @@
|
|||
from sat.core.i18n import _
|
||||
from sat.core.constants import Const as C
|
||||
from sat.core.log import getLogger
|
||||
|
||||
log = getLogger(__name__)
|
||||
from wokkel import compat
|
||||
from twisted.words.xish import domish
|
||||
|
||||
|
||||
|
||||
PLUGIN_INFO = {
|
||||
C.PI_NAME: "XEP-0049 Plugin",
|
||||
C.PI_IMPORT_NAME: "XEP-0049",
|
||||
|
|
@ -34,12 +34,12 @@ PLUGIN_INFO = {
|
|||
C.PI_DEPENDENCIES: [],
|
||||
C.PI_MAIN: "XEP_0049",
|
||||
C.PI_HANDLER: "no",
|
||||
C.PI_DESCRIPTION: _("""Implementation of private XML storage""")
|
||||
C.PI_DESCRIPTION: _("""Implementation of private XML storage"""),
|
||||
}
|
||||
|
||||
|
||||
class XEP_0049(object):
|
||||
NS_PRIVATE = 'jabber:iq:private'
|
||||
NS_PRIVATE = "jabber:iq:private"
|
||||
|
||||
def __init__(self, host):
|
||||
log.info(_("Plugin XEP-0049 initialization"))
|
||||
|
|
@ -55,7 +55,7 @@ class XEP_0049(object):
|
|||
client = self.host.getClient(profile_key)
|
||||
# XXX: feature announcement in disco#info is not mandatory in XEP-0049, so we have to try to use private XML, and react according to the answer
|
||||
iq_elt = compat.IQ(client.xmlstream)
|
||||
query_elt = iq_elt.addElement('query', XEP_0049.NS_PRIVATE)
|
||||
query_elt = iq_elt.addElement("query", XEP_0049.NS_PRIVATE)
|
||||
query_elt.addChild(element)
|
||||
return iq_elt.send()
|
||||
|
||||
|
|
@ -69,13 +69,14 @@ class XEP_0049(object):
|
|||
"""
|
||||
client = self.host.getClient(profile_key)
|
||||
# XXX: see privateXMLStore note about feature checking
|
||||
iq_elt = compat.IQ(client.xmlstream, 'get')
|
||||
query_elt = iq_elt.addElement('query', XEP_0049.NS_PRIVATE)
|
||||
iq_elt = compat.IQ(client.xmlstream, "get")
|
||||
query_elt = iq_elt.addElement("query", XEP_0049.NS_PRIVATE)
|
||||
query_elt.addElement(node_name, namespace)
|
||||
|
||||
def getCb(answer_iq_elt):
|
||||
answer_query_elt = answer_iq_elt.elements(XEP_0049.NS_PRIVATE, 'query').next()
|
||||
answer_query_elt = answer_iq_elt.elements(XEP_0049.NS_PRIVATE, "query").next()
|
||||
return answer_query_elt.firstChildElement()
|
||||
|
||||
d = iq_elt.send()
|
||||
d.addCallback(getCb)
|
||||
return d
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue