3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 13:09:23 +01:00

plugin stats: Refactor multiline function call

Signed-off-by: Celelibi <celelibi@gmail.com>
This commit is contained in:
Celelibi 2020-06-19 03:50:17 +02:00 committed by James Lu
parent 88116dbe8d
commit 7204ef1cf1

View File

@ -115,11 +115,9 @@ def handle_stats(irc, source, command, args):
for accountname, accountdata in conf.conf['login'].get('accounts', {}).items():
networks = accountdata.get('networks', [])
if irc.name in networks or not networks:
_num(243, "O %s * %s :%s" % (
' '.join(accountdata.get('hosts', ['*@*'])),
accountname,
'needoper' if accountdata.get('require_oper') else '')
)
hosts = ' '.join(accountdata.get('hosts', ['*@*']))
needoper = 'needoper' if accountdata.get('require_oper') else ''
_num(243, "O %s * %s :%s" % (hosts, accountname, needoper))
elif stats_type == 'u':
# 242/RPL_STATSUPTIME: ":Server Up <days> days <hours>:<minutes>:<seconds>"