code style reformatting using black
This commit is contained in:
parent
4127bcffd0
commit
744cb0c503
1 changed files with 21394 additions and 10488 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue