MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / translate_path

Method translate_path

tools/dev/range_file_server.py:13–19  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

11 strip_prefix = ""
12
13 def translate_path(self):
14 path = unquote(urlparse(self.path).path).lstrip("/")
15 if self.strip_prefix and path == self.strip_prefix:
16 path = ""
17 elif self.strip_prefix and path.startswith(self.strip_prefix + "/"):
18 path = path[len(self.strip_prefix) + 1:]
19 return (self.root / path).resolve()
20
21 def send_file(self, head_only=False):
22 file_path = self.translate_path()

Callers 1

send_fileMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected