Coverage for appr/commands/runserver.py: 57%

# Coverage for appr/commands/runserver.py : 57%

## 21 statements 12 run 9 missing 0 excluded

Hot-keys on this page

r m x p toggle line displays

j k next/prev highlighted chunk

0 (zero) top of page

1 (one) first highlighted chunk

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | from __future__ import absolute_import, division, print_function from appr.api.gevent_app import GeventApp from appr.commands.command_base import CommandBase class RunServerCmd(CommandBase): name = 'run-server' help_message = 'Run the registry server (with gunicorn)' parse_unknown = False def __init__(self, options, unknown=None): super(RunServerCmd, self).__init__(options) self.options = options self.status = {} def _call(self): GeventApp(self.options).run() @classmethod def _add_arguments(cls, parser): parser.add_argument("-p", "--port", nargs="?", default=5000, type=int, help="server port listen") parser.add_argument("-b", "--bind", nargs="?", default="0.0.0.0", help="server bind address") parser.add_argument("--db-class", nargs="?", default="filesystem", help="db class for storage") def _render_dict(self): return self.status def _render_console(self): return self.status['result']