MCPcopy
hub / github.com/plotly/dash / _infer_path

Function _infer_path

dash/_pages.py:65–82  ·  view source on GitHub ↗
(module_name, template)

Source from the content-addressed store, hash-verified

63
64
65def _infer_path(module_name, template):
66 if template is None:
67 if CONFIG.pages_folder:
68 pages_module = str(Path(CONFIG.pages_folder).name)
69 path = (
70 module_name.split(pages_module)[-1]
71 .replace("_", "-")
72 .replace(".", "/")
73 .lower()
74 )
75 else:
76 path = module_name.replace("_", "-").replace(".", "/").lower()
77 else:
78 # replace the variables in the template with "none" to create a default path if
79 # no path is supplied
80 path = re.sub("<.*?>", "none", template)
81 path = "/" + path if not path.startswith("/") else path
82 return path
83
84
85def _module_name_is_package(module_name):

Callers 1

register_pageFunction · 0.85

Calls 1

subMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…