|
|
|
@ -101,9 +101,9 @@ def show_workers(args):
|
|
|
|
|
for w in ws:
|
|
|
|
|
worker_queues = filter_queues(w.queue_names())
|
|
|
|
|
if not args.raw:
|
|
|
|
|
print '%s %s: %s' % (w.name, state_symbol(w.state), ', '.join(worker_queues))
|
|
|
|
|
print('%s %s: %s' % (w.name, state_symbol(w.state), ', '.join(worker_queues)))
|
|
|
|
|
else:
|
|
|
|
|
print 'worker %s %s %s' % (w.name, w.state, ','.join(worker_queues))
|
|
|
|
|
print('worker %s %s %s' % (w.name, w.state, ','.join(worker_queues)))
|
|
|
|
|
else:
|
|
|
|
|
# Create reverse lookup table
|
|
|
|
|
queues = dict([(q, []) for q in qs])
|
|
|
|
@ -119,21 +119,21 @@ def show_workers(args):
|
|
|
|
|
queues_str = ", ".join(sorted(map(lambda w: '%s (%s)' % (w.name, state_symbol(w.state)), queues[q])))
|
|
|
|
|
else:
|
|
|
|
|
queues_str = '–'
|
|
|
|
|
print '%s %s' % (pad(q.name + ':', max_qname + 1), queues_str)
|
|
|
|
|
print('%s %s' % (pad(q.name + ':', max_qname + 1), queues_str))
|
|
|
|
|
|
|
|
|
|
if not args.raw:
|
|
|
|
|
print '%d workers, %d queues' % (len(ws), len(qs))
|
|
|
|
|
print('%d workers, %d queues' % (len(ws), len(qs)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def show_both(args):
|
|
|
|
|
show_queues(args)
|
|
|
|
|
if not args.raw:
|
|
|
|
|
print ''
|
|
|
|
|
print('')
|
|
|
|
|
show_workers(args)
|
|
|
|
|
if not args.raw:
|
|
|
|
|
print ''
|
|
|
|
|
print('')
|
|
|
|
|
import datetime
|
|
|
|
|
print 'Updated: %s' % datetime.datetime.now()
|
|
|
|
|
print('Updated: %s' % datetime.datetime.now())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def parse_args():
|
|
|
|
@ -186,5 +186,5 @@ def main():
|
|
|
|
|
print(e)
|
|
|
|
|
sys.exit(1)
|
|
|
|
|
except KeyboardInterrupt:
|
|
|
|
|
print
|
|
|
|
|
print()
|
|
|
|
|
sys.exit(0)
|
|
|
|
|