Fix directories not normalised when trailing slash is present
This commit is contained in:
parent
ad55d4011b
commit
122a59cbb6
@ -46,13 +46,21 @@ class Normalisename:
|
||||
return [self.normalise(path) for path in paths]
|
||||
|
||||
def normalise(self, path):
|
||||
path = self.strip_trailing_slash(path)
|
||||
directory = dirname(path)
|
||||
filename = basename(path)
|
||||
normalpath = joinpath(directory, self.normalname(filename))
|
||||
|
||||
if path != normalpath:
|
||||
self.operation(path, normalpath) # pylint: disable=not-callable
|
||||
return normalpath
|
||||
|
||||
@staticmethod
|
||||
def strip_trailing_slash(path):
|
||||
if path[-1] == '/':
|
||||
path = path[:-1]
|
||||
return path
|
||||
|
||||
def normalname(self, filename):
|
||||
return unidecode(
|
||||
''.join(
|
||||
|
Loading…
Reference in New Issue
Block a user