def do_version(self, arguments): """display the installed Mercury version""" meta.print_version()
parser.add_argument("--no-http", default=False, action="store_true", help="do not start the integrated HTTP server") parser.add_argument( "--port", default=31415, metavar="PORT", type=int, help="specify the port on which to bind the server" ) parser.add_argument( "--ping-interval", default=15, metavar="SECS", type=int, help="the interval at which to ping connected agents" ) parser.add_argument( "--ssl", action=store_zero_or_two(), help="enable SSL, optionally specifying the key and certificate", nargs="*" ) parser.add_argument("--version", action="store_true", help="display the installed Mercury version") arguments = parser.parse_args(sys.argv[2::]) if arguments.version: meta.print_version() sys.exit(0) if arguments.log != None: logger.addFileHandler(arguments.log) task.LoopingCall(heartbeat).start(arguments.ping_interval) if arguments.ssl != None: print "Starting Mercury server, listening on 0.0.0.0:%d (with SSL)" % arguments.port if arguments.ssl == []: print "Using default SSL key material..." arguments.ssl = Provider().get_keypair("mercury-server")