From 0c656ab10c1d0bd9ef125fd58effeae917855b7e Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Tue, 25 Jan 2022 00:32:52 +0200 Subject: [PATCH] - fixed a syntax error in a call of the log.error() - trying to solve a 'circular reference' error when saving a project in Arch Linux --- CHANGELOG.md | 5 +++++ app_Main.py | 3 +-- camlib.py | 22 ++++++++++++---------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ecf7784e..f3228a89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ CHANGELOG for FlatCAM beta ================================================= +24.01.2022 + +- fixed a syntax error in a call of the log.error() +- trying to solve a 'circular reference' error when saving a project in Arch Linux + 22.01.2022 - improved the running of scripts when loading from GUI a script as a FlatCAM script diff --git a/app_Main.py b/app_Main.py index fb94975d..28c801f2 100644 --- a/app_Main.py +++ b/app_Main.py @@ -11906,7 +11906,6 @@ class MenuFileHandlers(QtCore.QObject): except Exception as e: self.log.error("save_project() --> There was no active object. Skipping read_form. %s" % str(e)) - # Serialize the whole project d = { "objs": [obj.to_dict() for obj in self.app.collection.get_list()], "options": self.app.options, @@ -11925,7 +11924,7 @@ class MenuFileHandlers(QtCore.QObject): out2 = compressor_obj.flush() project_zipped = b"".join([out1, out2]) except Exception: - self.log.error("Failed to save file: %s", str(filename)) + self.log.error("Failed to save file: %s" % str(filename)) self.inform.emit('[ERROR_NOTCL] %s' % _("Failed.")) return diff --git a/camlib.py b/camlib.py index b174d9b3..eafbc1c9 100644 --- a/camlib.py +++ b/camlib.py @@ -50,6 +50,14 @@ from appCommon.Common import GracefulException as grace from appParsers.ParseSVG import * from appParsers.ParseDXF import * +import logging + +import gettext +import appTranslation as fcTranslate +import builtins + +import copy + HAS_ORTOOLS = True if platform.architecture()[0] == '64bit': @@ -59,12 +67,6 @@ if platform.architecture()[0] == '64bit': except ModuleNotFoundError: HAS_ORTOOLS = False -import logging - -import gettext -import appTranslation as fcTranslate -import builtins - fcTranslate.apply_language('strings') log = logging.getLogger('base2') @@ -2271,10 +2273,10 @@ class Geometry(object): :return: A dictionary-encoded copy of the object. :rtype: dict """ - d = {} - for attr in self.ser_attrs: - d[attr] = getattr(self, attr) - return d + # d = {} + # for attr in self.ser_attrs: + # d[attr] = getattr(self, attr) + return {attr: copy.copy(getattr(self, attr)) for attr in self.ser_attrs} def from_dict(self, d): """