Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions dvc/path_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __init__(self, url):
assert not p.query and not p.params and not p.fragment
assert p.password is None

self.fill_parts(p.scheme, p.hostname, p.username, p.port, p.path)
self._fill_parts(p.scheme, p.hostname, p.username, p.port, p.path)

@classmethod
def from_parts(
Expand All @@ -127,10 +127,10 @@ def from_parts(
return cls("{}://{}{}".format(scheme, netloc, path))

obj = cls.__new__(cls)
obj.fill_parts(scheme, host, user, port, path)
obj._fill_parts(scheme, host, user, port, path)
return obj

def fill_parts(self, scheme, host, user, port, path):
def _fill_parts(self, scheme, host, user, port, path):
assert scheme != "remote"
assert isinstance(path, (str, bytes, _URLPathInfo))

Expand Down Expand Up @@ -244,6 +244,8 @@ def path(self):


class HTTPURLInfo(URLInfo):
__hash__ = URLInfo.__hash__

def __init__(self, url):
p = urlparse(url)
stripped = p._replace(params=None, query=None, fragment=None)
Expand Down Expand Up @@ -280,7 +282,7 @@ def from_parts(
)

obj = cls.__new__(cls)
obj.fill_parts(scheme, host, user, port, path)
obj._fill_parts(scheme, host, user, port, path)
obj.params = params
obj.query = query
obj.fragment = fragment
Expand Down Expand Up @@ -314,6 +316,3 @@ def __eq__(self, other):
and self._path == other._path
and self._extra_parts == other._extra_parts
)

def __hash__(self):
return hash(self.parts)