Simplify trailing slash handling to make going up work
This commit is contained in:
parent
7997c40e94
commit
210d0459eb
5
av98.py
5
av98.py
|
@ -110,10 +110,7 @@ class GeminiItem():
|
||||||
return GeminiItem(self._derive_url("/"))
|
return GeminiItem(self._derive_url("/"))
|
||||||
|
|
||||||
def up(self):
|
def up(self):
|
||||||
pathbits = list(os.path.split(self.path))
|
pathbits = list(os.path.split(self.path.rstrip('/')))
|
||||||
# Get rid of empty string from trailing /
|
|
||||||
if not pathbits[-1]:
|
|
||||||
pathbits.pop()
|
|
||||||
# Don't try to go higher than root
|
# Don't try to go higher than root
|
||||||
if len(pathbits) == 1:
|
if len(pathbits) == 1:
|
||||||
return self
|
return self
|
||||||
|
|
Loading…
Reference in New Issue