AV-98-fork

A fork of https://tildegit.org/solderpunk/AV-98
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit 210d0459eb185c87fc954e4aae4e90809d171945
parent 7997c40e94f54b1947a5a01acaff34e9c153da62
Author: lel <lel@envs.net>
Date:   Sat, 28 Sep 2019 03:28:01 -0400

Simplify trailing slash handling to make going up work

Diffstat:
Mav98.py | 5+----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/av98.py b/av98.py @@ -110,10 +110,7 @@ class GeminiItem(): return GeminiItem(self._derive_url("/")) def up(self): - pathbits = list(os.path.split(self.path)) - # Get rid of empty string from trailing / - if not pathbits[-1]: - pathbits.pop() + pathbits = list(os.path.split(self.path.rstrip('/'))) # Don't try to go higher than root if len(pathbits) == 1: return self