parser.add_argument('--path','-P',default='.',help='Specify the import path.')
parser.add_argument('--interval','-i',metavar='N',type=float,default=2.5,help='Updates stats every N seconds (default: don\'t poll)')# noqa
parser.add_argument('--raw','-r',action='store_true',default=False,help='Print only the raw numbers, no bar charts')# noqa
parser.add_argument('--only-queues','-Q',dest='only_queues',default=False,action='store_true',help='Show only queue info')# noqa
parser.add_argument('--only-workers','-W',dest='only_workers',default=False,action='store_true',help='Show only worker info')# noqa
parser.add_argument('--by-queue','-R',dest='by_queue',default=False,action='store_true',help='Shows workers by queue')# noqa
parser.add_argument('--empty-failed-queue','-X',dest='empty_failed_queue',default=False,action='store_true',help='Empties the failed queue, then quits')# noqa
parser.add_argument('queues',nargs='*',help='The queues to poll')
returnparser.parse_args()
definterval(val,func,args):
defrefresh(val,func,*args):
whileTrue:
ifvalandsys.stdout.isatty():
os.system('clear')
func(args)
ifvalandsys.stdout.isatty():
ifval:
click.clear()
func(*args)
ifval:
time.sleep(val)
else:
break
defmain():
args=parse_args()
ifargs.path:
sys.path=args.path.split(':')+sys.path
@click.command()
@click.option('--path','-P',default='.',help='Specify the import path.')
@click.option('--interval','-i',default=2.5,help='Updates stats every N seconds (default: don\'t poll)')# noqa
@click.option('--raw','-r',is_flag=True,help='Print only the raw numbers, no bar charts')# noqa
@click.option('--only-queues','-Q',is_flag=True,help='Show only queue info')# noqa
@click.option('--only-workers','-W',is_flag=True,help='Show only worker info')# noqa
@click.option('--by-queue','-R',is_flag=True,help='Shows workers by queue')# noqa