Reverted changes to read_form_item(). See #193.

This commit is contained in:
Juan Pablo Caram
2016-02-29 13:59:20 -05:00
parent 3280427894
commit 0cc60576ab

View File

@@ -144,7 +144,6 @@ class FlatCAMObj(QtCore.QObject):
except: except:
self.app.log.warning("Unexpected error:", sys.exc_info()) self.app.log.warning("Unexpected error:", sys.exc_info())
def build_ui(self): def build_ui(self):
""" """
Sets up the UI/form for this object. Show the UI Sets up the UI/form for this object. Show the UI
@@ -199,16 +198,22 @@ class FlatCAMObj(QtCore.QObject):
:type option: str :type option: str
:return: None :return: None
""" """
#try read field only when option have equivalent in form_fields
if option in self.form_fields: try:
option_type=type(self.options[option]) self.options[option] = self.form_fields[option].get_value()
try: except KeyError:
value=self.form_fields[option].get_value() self.app.log.warning("Failed to read option from field: %s" % option)
#catch per option as it was ignored anyway, also when syntax error (probably uninitialized field),don't read either.
except (KeyError,SyntaxError): # #try read field only when option have equivalent in form_fields
self.app.log.warning("Failed to read option from field: %s" % option) # if option in self.form_fields:
else: # option_type=type(self.options[option])
self.app.log.warning("Form fied does not exists: %s" % option) # try:
# value=self.form_fields[option].get_value()
# #catch per option as it was ignored anyway, also when syntax error (probably uninitialized field),don't read either.
# except (KeyError,SyntaxError):
# self.app.log.warning("Failed to read option from field: %s" % option)
# else:
# self.app.log.warning("Form fied does not exists: %s" % option)
def plot(self): def plot(self):
""" """