Avoid useless './' in file paths

Replaced useless 'os.path.relpath(os.getcwd())' statement with 'os.curdir' (which is equal to '.').

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
This commit is contained in:
JoeLametta
2021-05-16 17:19:14 +00:00
parent 078d3515ab
commit 731453ea8d
2 changed files with 3 additions and 1 deletions

View File

@@ -280,7 +280,7 @@ Log files will log the path to tracks relative to this directory.
"supports this feature. ")
self.parser.add_argument('-O', '--output-directory',
action="store", dest="output_directory",
default=os.path.relpath(os.getcwd()),
default=os.curdir,
help="output directory; will be included "
"in file paths in log")
self.parser.add_argument('-W', '--working-directory',

View File

@@ -239,6 +239,8 @@ class Program:
# Avoid filtering non str type values, replace None with empty string
v_fltr = {k: self._filter.filter(v2) if isinstance(v2, str) else ''
if v2 is None else v2 for k, v2 in v.items()}
if outdir == os.curdir:
return template % v_fltr # Avoid useless './' in file paths
return os.path.join(outdir, template % v_fltr)
@staticmethod