diff --git a/datalad_hirni/commands/dicom2spec.py b/datalad_hirni/commands/dicom2spec.py index e8283917..59fe0913 100644 --- a/datalad_hirni/commands/dicom2spec.py +++ b/datalad_hirni/commands/dicom2spec.py @@ -56,8 +56,21 @@ def __init__(self, dataset=None): self._rule_set = [] # get a list of paths to build the rule set from # Note: assure_list is supposed to return empty list if there's nothing - self._file_list = \ - assure_list(cfg.get("datalad.hirni.dicom2spec.rules")) + + try: + self._file_list = assure_list( + cfg.get("datalad.hirni.dicom2spec.rules", get_all=True) + ) + except TypeError as e: + if "unexpected keyword argument 'get_all'" in str(e): + # Older datalad version should return multiple values w/o + # needing get_all: + self._file_list = assure_list( + cfg.get("datalad.hirni.dicom2spec.rules") + ) + else: + raise + lgr.debug("loaded list of rule files: %s", self._file_list) for file in self._file_list: @@ -362,10 +375,6 @@ def __call__(path=None, spec=None, dataset=None, subject=None, yield meta continue - - - - if 'dicom' not in meta['metadata']: # TODO: Really "notneeded" or simply not a result at all?