summaryrefslogtreecommitdiff
path: root/plugins/uptime.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2018-08-15 13:13:17 +0200
committermathieui <mathieui@mathieui.net>2018-08-15 13:13:17 +0200
commit6e13b8b73572f9c0ac9b5c683b98a475afbeab38 (patch)
tree7dae86588339a8cf144b2d98c9280f28646341a9 /plugins/uptime.py
parentd1b624753bb5371cf287cc9d86bb685593a99315 (diff)
downloadpoezio-6e13b8b73572f9c0ac9b5c683b98a475afbeab38.tar.gz
poezio-6e13b8b73572f9c0ac9b5c683b98a475afbeab38.tar.bz2
poezio-6e13b8b73572f9c0ac9b5c683b98a475afbeab38.tar.xz
poezio-6e13b8b73572f9c0ac9b5c683b98a475afbeab38.zip
yapf -rip on plugins
Diffstat (limited to 'plugins/uptime.py')
-rw-r--r--plugins/uptime.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/plugins/uptime.py b/plugins/uptime.py
index 0c471e1a..d5a07b7b 100644
--- a/plugins/uptime.py
+++ b/plugins/uptime.py
@@ -15,19 +15,26 @@ from poezio.plugin import BasePlugin
from poezio.common import parse_secs_to_str, safeJID
from slixmpp.xmlstream import ET
+
class Plugin(BasePlugin):
def init(self):
- self.api.add_command('uptime', self.command_uptime,
- usage='<jid>',
- help='Ask for the uptime of a server or component (see XEP-0012).',
- short='Get the uptime')
+ self.api.add_command(
+ 'uptime',
+ self.command_uptime,
+ usage='<jid>',
+ help='Ask for the uptime of a server or component (see XEP-0012).',
+ short='Get the uptime')
def command_uptime(self, arg):
def callback(iq):
for query in iq.xml.getiterator('{jabber:iq:last}query'):
- self.api.information('Server %s online since %s' % (iq['from'], parse_secs_to_str(int(query.attrib['seconds']))), 'Info')
+ self.api.information(
+ 'Server %s online since %s' %
+ (iq['from'], parse_secs_to_str(
+ int(query.attrib['seconds']))), 'Info')
return
self.api.information('Could not retrieve uptime', 'Error')
+
jid = safeJID(arg)
if not jid.server:
return