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

Method _relative_url_path

dash/dash.py:1110–1130  ·  view source on GitHub ↗
(relative_package_path="", namespace="")

Source from the content-addressed store, hash-verified

1108 # add the version number of the package as a query parameter
1109 # for cache busting
1110 def _relative_url_path(relative_package_path="", namespace=""):
1111 if any(
1112 relative_package_path.startswith(x + "/")
1113 for x in ["dcc", "html", "dash_table"]
1114 ):
1115 relative_package_path = relative_package_path.replace("dash.", "")
1116 version = importlib.import_module(
1117 f"{namespace}.{os.path.split(relative_package_path)[0]}"
1118 ).__version__
1119 else:
1120 version = importlib.import_module(namespace).__version__
1121
1122 module_path = os.path.join( # type: ignore[reportCallIssue]
1123 os.path.dirname(sys.modules[namespace].__file__), # type: ignore[reportCallIssue]
1124 relative_package_path,
1125 )
1126
1127 modified = int(os.stat(module_path).st_mtime)
1128
1129 fingerprint = build_fingerprint(relative_package_path, version, modified)
1130 return f"{self.config.requests_pathname_prefix}_dash-component-suites/{namespace}/{fingerprint}"
1131
1132 srcs = []
1133 for resource in resources:

Callers

nothing calls this directly

Calls 1

build_fingerprintFunction · 0.85

Tested by

no test coverage detected