In servers list, display its state
This commit is contained in:
parent
fd5fbf6c6c
commit
001ff35758
@ -41,17 +41,21 @@ def liste(toks, context, prompt):
|
|||||||
l = l.lower()
|
l = l.lower()
|
||||||
if l == "server" or l == "servers":
|
if l == "server" or l == "servers":
|
||||||
for srv in context.servers.keys():
|
for srv in context.servers.keys():
|
||||||
print (" - %s ;" % srv)
|
print (" - %s (state: %s) ;" % (srv,
|
||||||
|
"connected" if context.servers[srv].connected else "disconnected"))
|
||||||
if len(context.servers) == 0:
|
if len(context.servers) == 0:
|
||||||
print (" > No server loaded")
|
print (" > No server loaded")
|
||||||
|
|
||||||
elif l == "mod" or l == "mods" or l == "module" or l == "modules":
|
elif l == "mod" or l == "mods" or l == "module" or l == "modules":
|
||||||
for mod in context.modules.keys():
|
for mod in context.modules.keys():
|
||||||
print (" - %s ;" % mod)
|
print (" - %s ;" % mod)
|
||||||
if len(context.modules) == 0:
|
if len(context.modules) == 0:
|
||||||
print (" > No module loaded")
|
print (" > No module loaded")
|
||||||
|
|
||||||
elif l in prompt.HOOKS_LIST:
|
elif l in prompt.HOOKS_LIST:
|
||||||
f, d = prompt.HOOKS_LIST[l]
|
f, d = prompt.HOOKS_LIST[l]
|
||||||
f(d, context, prompt)
|
f(d, context, prompt)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print (" Unknown list `%s'" % l)
|
print (" Unknown list `%s'" % l)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user