code style reformatting using black

This commit is contained in:
Goffi 2018-06-27 20:14:46 +02:00
commit 744cb0c503

View file

@ -20,6 +20,7 @@
from sat.core.i18n import _, D_
from sat.core.constants import Const as C
from sat.core.log import getLogger
log = getLogger(__name__)
from sat.core import exceptions
from sat.tools import xml_tools
@ -33,7 +34,9 @@ PLUGIN_INFO = {
C.PI_DEPENDENCIES: [],
C.PI_MAIN: "Watched",
C.PI_HANDLER: "no",
C.PI_DESCRIPTION: _("""Watch for entities presence, and send notification accordingly""")
C.PI_DESCRIPTION: _(
"""Watch for entities presence, and send notification accordingly"""
),
}
@ -51,11 +54,9 @@ class Watched(object):
</category>
</individual>
</params>
""".format(category_name=CATEGORY,
category_label=_(CATEGORY),
name=NAME,
label=_(NAME),
)
""".format(
category_name=CATEGORY, category_label=_(CATEGORY), name=NAME, label=_(NAME)
)
def __init__(self, host):
log.info(_("Watched initialisation"))
@ -76,6 +77,13 @@ class Watched(object):
if old_show == C.PRESENCE_UNAVAILABLE:
watched = self.host.memory.getParamA(NAME, CATEGORY, profile_key=profile)
if entity in watched or entity.userhostJID() in watched:
self.host.actionNew({'xmlui': xml_tools.note(_(NOTIF).format(entity=entity.full())).toXml()}, profile=profile)
self.host.actionNew(
{
"xmlui": xml_tools.note(
_(NOTIF).format(entity=entity.full())
).toXml()
},
profile=profile,
)
return True