MCPcopy
hub / github.com/django/django / split_leading_dir

Method split_leading_dir

django/utils/archive.py:117–127  ·  view source on GitHub ↗
(self, path)

Source from the content-addressed store, hash-verified

115 os.chmod(filename, mode)
116
117 def split_leading_dir(self, path):
118 path = str(path)
119 path = path.lstrip("/").lstrip("\\")
120 if "/" in path and (
121 ("\\" in path and path.find("/") < path.find("\\")) or "\\" not in path
122 ):
123 return path.split("/", 1)
124 elif "\\" in path:
125 return path.split("\\", 1)
126 else:
127 return path, ""
128
129 def has_leading_dir(self, paths):
130 """

Callers 3

has_leading_dirMethod · 0.95
extractMethod · 0.80
extractMethod · 0.80

Calls 2

findMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected