Added check for string in outputs.drill.map/report.

Also support 'None' as Python None.
This commit is contained in:
Salvador E. Tropea 2020-06-30 19:59:21 -03:00
parent 60a2649c0f
commit f579d648bf
1 changed files with 9 additions and 1 deletions

View File

@ -49,7 +49,11 @@ class AnyDrill(BaseOutput):
if not isinstance(type, str):
raise KiPlotConfigurationError("drill `map` `type` must be a string")
val = type
if val not in self._map_map:
elif not isinstance(val, str):
raise KiPlotConfigurationError("drill `map` must be a string")
if val == 'None':
val = None
elif val not in self._map_map:
raise KiPlotConfigurationError("Unknown drill `map` `type`: {}".format(val))
self._map = val
@ -71,6 +75,10 @@ class AnyDrill(BaseOutput):
if not isinstance(filename, str):
raise KiPlotConfigurationError("drill `report` `filename` must be a string")
val = filename
elif not isinstance(val, str):
raise KiPlotConfigurationError("drill `report` must be a string")
if val == 'None':
val = None
self._report = val
def config(self, outdir, options, layers):