code style reformatting using black
This commit is contained in:
parent
4127bcffd0
commit
744cb0c503
1 changed files with 21394 additions and 10488 deletions
|
|
@ -21,6 +21,7 @@
|
|||
from sat.core.i18n import _, D_
|
||||
from sat.core.constants import Const as C
|
||||
from sat.core.log import getLogger
|
||||
|
||||
log = getLogger(__name__)
|
||||
|
||||
|
||||
|
|
@ -33,7 +34,7 @@ PLUGIN_INFO = {
|
|||
C.PI_RECOMMENDATIONS: [],
|
||||
C.PI_MAIN: "DirectorySubscription",
|
||||
C.PI_HANDLER: "no",
|
||||
C.PI_DESCRIPTION: _("""Implementation of directory subscription""")
|
||||
C.PI_DESCRIPTION: _("""Implementation of directory subscription"""),
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -42,11 +43,15 @@ CMD_UPDATE_SUBSCRIBTION = "update"
|
|||
|
||||
|
||||
class DirectorySubscription(object):
|
||||
|
||||
def __init__(self, host):
|
||||
log.info(_("Directory subscription plugin initialization"))
|
||||
self.host = host
|
||||
host.importMenu((D_("Service"), D_("Directory subscription")), self.subscribe, security_limit=1, help_string=D_("User directory subscription"))
|
||||
host.importMenu(
|
||||
(D_("Service"), D_("Directory subscription")),
|
||||
self.subscribe,
|
||||
security_limit=1,
|
||||
help_string=D_("User directory subscription"),
|
||||
)
|
||||
|
||||
def subscribe(self, raw_data, profile):
|
||||
"""Request available commands on the jabber search service associated to profile's host.
|
||||
|
|
@ -59,7 +64,9 @@ class DirectorySubscription(object):
|
|||
|
||||
def got_services(services):
|
||||
service_jid = services[0]
|
||||
session_id, session_data = self.host.plugins["XEP-0050"].requesting.newSession(profile=profile)
|
||||
session_id, session_data = self.host.plugins[
|
||||
"XEP-0050"
|
||||
].requesting.newSession(profile=profile)
|
||||
session_data["jid"] = service_jid
|
||||
session_data["node"] = CMD_UPDATE_SUBSCRIBTION
|
||||
data = {"session_id": session_id}
|
||||
|
|
|
|||
Loading…
Reference in a new issue