@@ -140,14 +140,26 @@ def compute_parameters(self, filename: str, file_info: dict, parameter_type: str
140
140
result = eval (str (parameter_info ["New Value" ]), {}, variables ) # noqa: S307 pylint: disable=eval-used
141
141
142
142
# convert (combobox) string text to (parameter value) string int or float
143
- if isinstance (result , str ) and parameter in variables ["doc_dict" ]:
144
- values = variables ["doc_dict" ][parameter ]["values" ]
145
- if values :
146
- result = next (key for key , value in values .items () if value == result )
143
+ if isinstance (result , str ):
144
+ if parameter in variables ["doc_dict" ]:
145
+ values = variables ["doc_dict" ][parameter ]["values" ]
146
+ if values :
147
+ result = next (key for key , value in values .items () if value == result )
148
+ else :
149
+ bitmasks = variables ["doc_dict" ][parameter ]["Bitmask" ]
150
+ if bitmasks :
151
+ result = 2 ** next (key for key , bitmask in bitmasks .items () if bitmask == result )
147
152
else :
148
- bitmasks = variables ["doc_dict" ][parameter ]["Bitmask" ]
149
- if bitmasks :
150
- result = 2 ** next (key for key , bitmask in bitmasks .items () if bitmask == result )
153
+ error_msg = _ (
154
+ "In file '{self.configuration_steps_filename}': '{filename}' {parameter_type} "
155
+ "parameter '{parameter}' could not be computed, no documentation metadata available for it"
156
+ )
157
+ error_msg = error_msg .format (** locals ())
158
+ if parameter_type == "forced" :
159
+ logging_error (error_msg )
160
+ return error_msg
161
+ logging_warning (error_msg )
162
+ continue
151
163
152
164
if filename not in destination :
153
165
destination [filename ] = {}
0 commit comments