Remove the poorly-named Link.url_fragment property.

This commit is contained in:
Carl Meyer 2012-04-16 16:05:21 -06:00
parent 0c05413b6f
commit d382a36cf6
1 changed files with 3 additions and 11 deletions

View File

@ -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)