Simplify normalize_paths

This commit is contained in:
Ian Cordasco 2016-01-09 21:14:36 -06:00
parent ec26d46dff
commit 237a35fe88
2 changed files with 2 additions and 8 deletions

View file

@ -167,7 +167,6 @@ def _normalize_option(options, option):
if option.comma_separated_list:
normalize = utils.normalize_paths
setattr(options, dest, normalize(old_value))
elif option.comma_separated_list:
old_value = getattr(options, dest)
setattr(options, dest,

View file

@ -29,12 +29,7 @@ def normalize_paths(paths, parent=os.curdir):
:rtype:
[str]
"""
paths = []
for path in parse_comma_separated_list(paths):
if '/' in path:
path = os.path.abspath(os.path.join(parent, path))
paths.append(path.rstrip('/'))
return paths
return [normalize_path(p) for p in parse_comma_separated_list(paths)]
def normalize_path(path, parent=os.curdir):
@ -47,4 +42,4 @@ def normalize_path(path, parent=os.curdir):
"""
if '/' in path:
path = os.path.abspath(os.path.join(parent, path))
return path
return path.rstrip('/')