MCPcopy Index your code
hub / github.com/plotly/dash / _infer_module_name

Function _infer_module_name

dash/_pages.py:96–110  ·  view source on GitHub ↗
(page_path)

Source from the content-addressed store, hash-verified

94
95
96def _infer_module_name(page_path):
97 relative_path = page_path.split(CONFIG.pages_folder)[-1]
98 module = _path_to_module_name(relative_path)
99 proj_root = get_root_path(CONFIG.name)
100 if CONFIG.pages_folder.startswith(proj_root):
101 parent_path = CONFIG.pages_folder[len(proj_root) :]
102 else:
103 parent_path = CONFIG.pages_folder
104 parent_module = _path_to_module_name(parent_path)
105
106 module_name = f"{parent_module}.{module}"
107 if _module_name_is_package(CONFIG.name):
108 # Only prefix with CONFIG.name when it's an imported package name
109 module_name = f"{CONFIG.name}.{module_name}"
110 return module_name
111
112
113def _parse_query_string(search):

Callers 1

Calls 3

_path_to_module_nameFunction · 0.85
get_root_pathFunction · 0.85
_module_name_is_packageFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…