From 0cc60576ab30bc6827b8aab96d222bbc89d128f2 Mon Sep 17 00:00:00 2001 From: Juan Pablo Caram Date: Mon, 29 Feb 2016 13:59:20 -0500 Subject: [PATCH] Reverted changes to read_form_item(). See #193. --- FlatCAMObj.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/FlatCAMObj.py b/FlatCAMObj.py index c6043026..b8315fc5 100644 --- a/FlatCAMObj.py +++ b/FlatCAMObj.py @@ -144,7 +144,6 @@ class FlatCAMObj(QtCore.QObject): except: self.app.log.warning("Unexpected error:", sys.exc_info()) - def build_ui(self): """ Sets up the UI/form for this object. Show the UI @@ -199,16 +198,22 @@ class FlatCAMObj(QtCore.QObject): :type option: str :return: None """ - #try read field only when option have equivalent in form_fields - if option in self.form_fields: - option_type=type(self.options[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) + + try: + self.options[option] = self.form_fields[option].get_value() + except KeyError: + self.app.log.warning("Failed to read option from field: %s" % option) + + # #try read field only when option have equivalent in form_fields + # if option in self.form_fields: + # option_type=type(self.options[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): """