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

Function cdn_validation

pywebio/platform/utils.py:12–30  ·  view source on GitHub ↗

CDN availability check :param bool/str cdn: cdn parameter :param level: warn or error :param stacklevel: stacklevel=3 to makes the warning refer to cdn_validation() caller’s caller

(cdn, level='warn', stacklevel=3)

Source from the content-addressed store, hash-verified

10
11
12def cdn_validation(cdn, level='warn', stacklevel=3):
13 """CDN availability check
14
15 :param bool/str cdn: cdn parameter
16 :param level: warn or error
17 :param stacklevel: stacklevel=3 to makes the warning refer to cdn_validation() caller’s caller
18 """
19 assert level in ('warn', 'error')
20
21 if cdn is True and 'dev' in version:
22 if level == 'warn':
23 import warnings
24 warnings.warn("Default CDN is not supported in dev version. Ignore the CDN setting", PyWebIOWarning,
25 stacklevel=stacklevel)
26 return False
27 else:
28 raise ValueError("Default CDN is not supported in dev version. Please host static files by yourself.")
29
30 return cdn
31
32
33class OriginChecker:

Callers 14

webio_viewFunction · 0.85
wsgi_appFunction · 0.85
webio_routesFunction · 0.85
asgi_appFunction · 0.85
webio_viewFunction · 0.85
wsgi_appFunction · 0.85
webio_handlerFunction · 0.85
start_serverFunction · 0.85
path_deployFunction · 0.85
path_deploy_httpFunction · 0.85
webio_handlerFunction · 0.85
start_serverFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…