Enhance ConfigEditor to handle error condition

This patch enhanced ConfigEditor to handle the case that the app
will crash when "Value" is not provided in YAML. It also fixed
an hide/show issue for Table type widget.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This commit is contained in:
Maurice Ma
2021-05-14 11:15:19 -07:00
parent c6ddf6fd38
commit 126a2c5f03
2 changed files with 7 additions and 2 deletions
+5 -2
View File
@@ -509,7 +509,8 @@ class application(tkinter.Frame):
result = self.evaluate_condition(item)
if result == 2:
# Gray
widget.configure(state='disabled')
if not isinstance(widget, custom_table):
widget.configure(state='disabled')
elif result == 0:
# Hide
visible = False
@@ -517,7 +518,9 @@ class application(tkinter.Frame):
else:
# Show
widget.grid()
widget.configure(state='normal')
if not isinstance(widget, custom_table):
widget.configure(state='normal')
return visible
+2
View File
@@ -769,6 +769,8 @@ class CGenCfgData:
def get_value (self, value_str, bit_length, array = True):
value_str = value_str.strip()
if len(value_str) == 0:
return 0
if value_str[0] == "'" and value_str[-1] == "'" or \
value_str[0] == '"' and value_str[-1] == '"':
value_str = value_str[1:-1]