mirror of https://github.com/pypa/pip
Remove the poorly-named Link.url_fragment property.
This commit is contained in:
parent
0c05413b6f
commit
d382a36cf6
14
pip/index.py
14
pip/index.py
|
@ -597,9 +597,9 @@ class Link(object):
|
|||
|
||||
@property
|
||||
def filename(self):
|
||||
url = self.url_fragment
|
||||
name = posixpath.basename(url)
|
||||
assert name, ('URL %r produced no filename' % url)
|
||||
_, netloc, path, _, _ = urlparse.urlsplit(self.url)
|
||||
name = posixpath.basename(path.rstrip('/')) or netloc
|
||||
assert name, ('URL %r produced no filename' % self.url)
|
||||
return name
|
||||
|
||||
@property
|
||||
|
@ -613,14 +613,6 @@ class Link(object):
|
|||
def splitext(self):
|
||||
return splitext(posixpath.basename(self.path.rstrip('/')))
|
||||
|
||||
@property
|
||||
def url_fragment(self):
|
||||
url = self.url
|
||||
url = url.split('#', 1)[0]
|
||||
url = url.split('?', 1)[0]
|
||||
url = url.rstrip('/')
|
||||
return url
|
||||
|
||||
@property
|
||||
def url_without_fragment(self):
|
||||
scheme, netloc, path, query, fragment = urlparse.urlsplit(self.url)
|
||||
|
|
Loading…
Reference in New Issue