MCPcopy Create free account
hub / github.com/aio-libs/aiohttp / init

Function init

examples/cli_app.py:29–53  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

27
28
29def init(argv):
30 arg_parser = ArgumentParser(
31 prog="aiohttp.web ...", description="Application CLI", add_help=False
32 )
33
34 # Positional argument
35 arg_parser.add_argument("message", help="message to print")
36
37 # Optional argument
38 arg_parser.add_argument(
39 "--repeat", help="number of times to repeat message", type=int, default="1"
40 )
41
42 # Avoid conflict with -h from `aiohttp.web` CLI parser
43 arg_parser.add_argument(
44 "--app-help", help="show this message and exit", action="help"
45 )
46
47 args = arg_parser.parse_args(argv)
48
49 app = web.Application()
50 app[args_key] = args
51 app.router.add_get("/", display_message)
52
53 return app

Callers

nothing calls this directly

Calls 1

add_getMethod · 0.80

Tested by

no test coverage detected