MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / _path_deploy

Function _path_deploy

pywebio/platform/path_deploy.py:187–215  ·  view source on GitHub ↗
(base, port=0, host='', static_dir=None, max_payload_size=2 ** 20 * 200,
                 **tornado_app_settings)

Source from the content-addressed store, hash-verified

185
186
187def _path_deploy(base, port=0, host='', static_dir=None, max_payload_size=2 ** 20 * 200,
188 **tornado_app_settings):
189 if not host:
190 host = '0.0.0.0'
191
192 if port == 0:
193 port = get_free_port()
194
195 tornado_app_settings = {k: v for k, v in tornado_app_settings.items() if v is not None}
196
197 abs_base = os.path.normpath(os.path.abspath(base))
198
199 register_session_implement(CoroutineBasedSession)
200 register_session_implement(ThreadBasedSession)
201
202 RequestHandler = yield abs_base
203
204 handlers = []
205 if static_dir is not None:
206 handlers.append((r"/static/(.*)", tornado.web.StaticFileHandler, {"path": static_dir}))
207 handlers.append((LOCAL_STATIC_URL + r"/(.*)", tornado.web.StaticFileHandler, {"path": STATIC_PATH}))
208 handlers.append((r"/.*", RequestHandler))
209
210 print_listen_address(host, port)
211
212 set_ioloop(tornado.ioloop.IOLoop.current()) # to enable bokeh app
213 app = tornado.web.Application(handlers=handlers, **tornado_app_settings)
214 app.listen(port, address=host, max_buffer_size=max_payload_size)
215 tornado.ioloop.IOLoop.current().start()
216
217
218def path_deploy(base, port=0, host='',

Callers 2

path_deployFunction · 0.85
path_deploy_httpFunction · 0.85

Calls 5

get_free_portFunction · 0.85
print_listen_addressFunction · 0.85
set_ioloopFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…