3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-30 14:49:28 +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(): for accountname, accountdata in conf.conf['login'].get('accounts', {}).items():
networks = accountdata.get('networks', []) networks = accountdata.get('networks', [])
if irc.name in networks or not networks: if irc.name in networks or not networks:
_num(243, "O %s * %s :%s" % ( hosts = ' '.join(accountdata.get('hosts', ['*@*']))
' '.join(accountdata.get('hosts', ['*@*'])), needoper = 'needoper' if accountdata.get('require_oper') else ''
accountname, _num(243, "O %s * %s :%s" % (hosts, accountname, needoper))
'needoper' if accountdata.get('require_oper') else '')
)
elif stats_type == 'u': elif stats_type == 'u':
# 242/RPL_STATSUPTIME: ":Server Up <days> days <hours>:<minutes>:<seconds>" # 242/RPL_STATSUPTIME: ":Server Up <days> days <hours>:<minutes>:<seconds>"