Skip to content
Permalink
Browse files

Improve code.

Signed-off-by: Volker Theile <votdev@gmx.de>
  • Loading branch information...
votdev committed Aug 14, 2019
1 parent 795d7d1 commit ce819a4c8a5e9add281f6955f444fa9299338c7d
Showing with 3 additions and 1 deletion.
  1. +3 −1 deb/openmediavault/usr/lib/python3/dist-packages/openmediavault/string.py
@@ -183,13 +183,15 @@ def binary_format(
def path_prettify(path):
"""
Make sure the directory path ends with a slash.
>>> assert path_prettify('/foo/bar') == '/foo/bar/'
>>> assert path_prettify('/foo/bar//') == '/foo/bar/'
:param path: The path to process.
:type path: str
:return: Returns the prettified path.
:rtype: str
"""
assert isinstance(path, str)
return path.rstrip('/') + '/'
return '{}/'.format(path.rstrip('/'))


def add_slashes(value):

0 comments on commit ce819a4

Please sign in to comment.
You can’t perform that action at this time.