Skip to content
Snippets Groups Projects
Commit 284a916f authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

MNT: emit warning when dupe image files detected

parent 594606d4
No related branches found
No related tags found
No related merge requests found
...@@ -1443,12 +1443,21 @@ def addExt(prefix, mustExist=True, unambiguous=True): ...@@ -1443,12 +1443,21 @@ def addExt(prefix, mustExist=True, unambiguous=True):
"""Adds a file extension to the given file ``prefix``. See """Adds a file extension to the given file ``prefix``. See
:func:`~fsl.utils.path.addExt`. :func:`~fsl.utils.path.addExt`.
""" """
return fslpath.addExt(prefix, try:
allowedExts=ALLOWED_EXTENSIONS, return fslpath.addExt(prefix,
mustExist=mustExist, allowedExts=ALLOWED_EXTENSIONS,
defaultExt=defaultExt(), mustExist=mustExist,
fileGroups=FILE_GROUPS, defaultExt=defaultExt(),
unambiguous=unambiguous) fileGroups=FILE_GROUPS,
unambiguous=unambiguous)
except fslpath.PathError as e:
# hacky: if more than one file with
# the prefix exists, we emit a
# warning, because in most cases
# this is a bad thing.
if str(e).startswith('More than'):
log.warning(e)
raise e
def splitExt(filename): def splitExt(filename):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment