BD2KOnFHIR / fhirtordf

Python based FHIR to RDF conversion utility
Creative Commons Zero v1.0 Universal
15 stars 8 forks source link

--indir argument doens't work if -sd is not provided #14

Closed esteban-aliverti closed 4 years ago

esteban-aliverti commented 5 years ago

The following error happens when using the --indir argument with no -sd argument:

$ fhirtordf -id resources -mv vocabulary/fhir.ttl -u http://dss.cora/ -no -o ttls/all.ttl

Loading FHIR metadata vocabulary...loaded from local cache
Traceback (most recent call last):
  File "/home/esteban/dev/cognitive/pocs/shex-poc/shex-step-by-step/venv/bin/fhirtordf", line 9, in <module>
    fhirtordf(sys.argv[1:])
  File "/home/esteban/dev/cognitive/pocs/shex-poc/shex-step-by-step/venv/lib/python3.5/site-packages/fhirtordf/fhirtordf.py", line 197, in fhirtordf
    nfiles, nsuccess = dlp.run(proc=proc_file, file_filter_2=file_filter)
  File "/home/esteban/dev/cognitive/pocs/shex-poc/shex-step-by-step/venv/lib/python3.5/site-packages/dirlistproc/DirectoryListProcessor.py", line 193, in run
    if self._check_filter(fn, dirpath, file_filter, file_filter_2):
  File "/home/esteban/dev/cognitive/pocs/shex-poc/shex-step-by-step/venv/lib/python3.5/site-packages/dirlistproc/DirectoryListProcessor.py", line 150, in _check_filter
    (not file_filter_2 or file_filter_2(fn, dirpath if dirpath is not None else '', self.opts)) and \
  File "/home/esteban/dev/cognitive/pocs/shex-poc/shex-step-by-step/venv/lib/python3.5/site-packages/fhirtordf/fhirtordf.py", line 123, in file_filter
    if indir and (indir.startswith("_") or "/_" in indir or any(dn in indir for dn in opts.skipdirs)):
TypeError: 'NoneType' object is not iterable

The same command, but providing an -sd argument (even if the directory doesn't exist) works:

$ fhirtordf -id resources -sd xxx -mv vocabulary/fhir.ttl -u http://dss.cora/ -no -o ttls/all.ttl
hsolbrig commented 4 years ago

Fixed in V1.3.2