Skip to content
Snippets Groups Projects
Commit 40c598cf authored by Danilo Ferreira de Lima's avatar Danilo Ferreira de Lima
Browse files

Bug fix reading data path: we have to avoid reading spaces and the comment character.

parent cf627845
No related branches found
No related tags found
2 merge requests!59Interface CrystFEL with Karabo and allow automatic parameter tunning with rcrystfel,!53Train picker arbiter kernel
......@@ -350,13 +350,15 @@ class CrystfelRunner(PythonDevice):
self.KARABO_ON_INPUT("input", self.input_handler)
# note: loading with cfelpyutils.geometry does not tell us peak_list value
# extra note: we need to avoid taking ';' and ' ' into the path!
# (Hence the large regexp on the right-hand side)
self._geom_data_path = None
self._geom_peak_path = None
with open(self.get("crystfelArgs.geometryPath"), "rt") as fd:
for line in fd:
if (match := re.match(r"data\s*=\s*(.*)$", line)):
if (match := re.match(r"data\s*=\s*([a-zA-Z0-9/\._]*)", line)):
self._geom_data_path = match.group(1)
elif (match := re.match(r"peak_list\s*=\s*(.*)$", line)):
elif (match := re.match(r"peak_list\s*=\s*([a-zA-Z0-9/\._]*)", line)):
self._geom_peak_path = match.group(1)
if None not in (self._geom_data_path, self._geom_peak_path):
break
......
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