def main(): options = read_args() zc = ZkClient(options.zserver, options.zport) zc.start() try: try: display(process(zc.spouts(options.spoutroot, options.topology)), true_or_false_option(options.friendly)) except ZkError, e: print 'Failed to access Zookeeper: %s' % str(e) return 1 except ProcessorError, e: print 'Failed to process: %s' % str(e) return 1
def top(): options = read_args() zc = ZkClient(options.zserver, options.zport) zc.start() try: curses.wrapper(curses_main, [zc, options]) #curses_main(None, [zc, options]) except KeyboardInterrupt: pass finally: zc.stop()