Просмотр исходного кода

- in Tools Database added a contextual menu to add/copy/delete tool; CTRL+C, DEL keys work too; key T for adding a tool is now only partially working
- in Tools Database made the status bar messages show when adding/copying/deleting tools in DB
- changed all Except statements that were single to except Exception as recommended in some PEP
- renamed the Copper Fill Tool to Copper Thieving Tool as this is a more appropriate name; started to add ability for more types of copper thieving besides solid
- fixed some issues recently introduced in ParseSVG
- updated POT file

Marius Stanciu 6 лет назад
Родитель
Сommit
70d123306c

Разница между файлами не показана из-за своего большого размера
+ 194 - 142
FlatCAMApp.py


+ 55 - 34
FlatCAMCommon.py

@@ -382,7 +382,7 @@ class BookmarkManager(QtWidgets.QWidget):
                 self.app.log.debug('Creating a new bookmarks file ...')
                 self.app.log.debug('Creating a new bookmarks file ...')
                 f = open(filename, 'w')
                 f = open(filename, 'w')
                 f.close()
                 f.close()
-            except:
+            except Exception:
                 e = sys.exc_info()[0]
                 e = sys.exc_info()[0]
                 self.app.log.error("Could not load defaults file.")
                 self.app.log.error("Could not load defaults file.")
                 self.app.log.error(str(e))
                 self.app.log.error(str(e))
@@ -395,7 +395,7 @@ class BookmarkManager(QtWidgets.QWidget):
                     for title, link in self.bm_dict.items():
                     for title, link in self.bm_dict.items():
                         line2write = str(title) + ':' + str(link) + '\n'
                         line2write = str(title) + ':' + str(link) + '\n'
                         f.write(line2write)
                         f.write(line2write)
-            except:
+            except Exception:
                 self.app.inform.emit('[ERROR_NOTCL] %s' % _("Failed to write bookmarks to file."))
                 self.app.inform.emit('[ERROR_NOTCL] %s' % _("Failed to write bookmarks to file."))
                 return
                 return
         self.app.inform.emit('[success] %s: %s' % (_("Exported bookmarks to"), filename))
         self.app.inform.emit('[success] %s: %s' % (_("Exported bookmarks to"), filename))
@@ -647,8 +647,8 @@ class ToolsDB(QtWidgets.QWidget):
         new_vlay = QtWidgets.QVBoxLayout()
         new_vlay = QtWidgets.QVBoxLayout()
         layout.addLayout(new_vlay)
         layout.addLayout(new_vlay)
 
 
-        new_tool_lbl = QtWidgets.QLabel('<b>%s</b>' % _("New Tool"))
-        new_vlay.addWidget(new_tool_lbl, alignment=QtCore.Qt.AlignBottom)
+        # new_tool_lbl = QtWidgets.QLabel('<b>%s</b>' % _("New Tool"))
+        # new_vlay.addWidget(new_tool_lbl, alignment=QtCore.Qt.AlignBottom)
 
 
         self.buttons_frame = QtWidgets.QFrame()
         self.buttons_frame = QtWidgets.QFrame()
         self.buttons_frame.setContentsMargins(0, 0, 0, 0)
         self.buttons_frame.setContentsMargins(0, 0, 0, 0)
@@ -700,8 +700,8 @@ class ToolsDB(QtWidgets.QWidget):
         # ######################## SIGNALS #############################################
         # ######################## SIGNALS #############################################
         # ##############################################################################
         # ##############################################################################
 
 
-        add_entry_btn.clicked.connect(self.on_add_entry)
-        remove_entry_btn.clicked.connect(self.on_remove_entry)
+        add_entry_btn.clicked.connect(self.on_tool_add)
+        remove_entry_btn.clicked.connect(self.on_tool_delete)
         export_db_btn.clicked.connect(self.on_export_tools_db_file)
         export_db_btn.clicked.connect(self.on_export_tools_db_file)
         import_db_btn.clicked.connect(self.on_import_tools_db_file)
         import_db_btn.clicked.connect(self.on_import_tools_db_file)
         # closebtn.clicked.connect(self.accept)
         # closebtn.clicked.connect(self.accept)
@@ -724,7 +724,7 @@ class ToolsDB(QtWidgets.QWidget):
 
 
         try:
         try:
             self.db_tool_dict = json.loads(tools)
             self.db_tool_dict = json.loads(tools)
-        except:
+        except Exception:
             e = sys.exc_info()[0]
             e = sys.exc_info()[0]
             self.app.log.error(str(e))
             self.app.log.error(str(e))
             self.app.inform.emit('[ERROR] %s' % _("Failed to parse Tools DB file."))
             self.app.inform.emit('[ERROR] %s' % _("Failed to parse Tools DB file."))
@@ -734,6 +734,14 @@ class ToolsDB(QtWidgets.QWidget):
 
 
         self.build_db_ui()
         self.build_db_ui()
 
 
+        self.table_widget.setupContextMenu()
+        self.table_widget.addContextMenu(
+            _("Add to DB"), self.on_tool_add, icon=QtGui.QIcon("share/plus16.png"))
+        self.table_widget.addContextMenu(
+            _("Copy from DB"), self.on_tool_copy, icon=QtGui.QIcon("share/copy16.png"))
+        self.table_widget.addContextMenu(
+            _("Delete from DB"), self.on_tool_delete, icon=QtGui.QIcon("share/delete32.png"))
+
     def build_db_ui(self):
     def build_db_ui(self):
         self.ui_disconnect()
         self.ui_disconnect()
         self.table_widget.setRowCount(len(self.db_tool_dict))
         self.table_widget.setRowCount(len(self.db_tool_dict))
@@ -772,7 +780,8 @@ class ToolsDB(QtWidgets.QWidget):
 
 
         nr_crt = row + 1
         nr_crt = row + 1
         id_item = QtWidgets.QTableWidgetItem('%d' % int(nr_crt))
         id_item = QtWidgets.QTableWidgetItem('%d' % int(nr_crt))
-        id_item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
+        # id_item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
+        id_item.setFlags(id_item.flags() & ~QtCore.Qt.ItemIsEditable)
         widget.setItem(row, 0, id_item)  # Tool name/id
         widget.setItem(row, 0, id_item)  # Tool name/id
 
 
         tool_name_item = QtWidgets.QTableWidgetItem(name)
         tool_name_item = QtWidgets.QTableWidgetItem(name)
@@ -930,7 +939,7 @@ class ToolsDB(QtWidgets.QWidget):
         endz_item.set_value(float(data['endz']))
         endz_item.set_value(float(data['endz']))
         widget.setCellWidget(row, 25, endz_item)
         widget.setCellWidget(row, 25, endz_item)
 
 
-    def on_add_entry(self):
+    def on_tool_add(self):
         """
         """
         Add a tool in the DB Tool Table
         Add a tool in the DB Tool Table
         :return: None
         :return: None
@@ -977,21 +986,39 @@ class ToolsDB(QtWidgets.QWidget):
             }
             }
         )
         )
 
 
+        # add the new entry to the Tools DB table
+        self.build_db_ui()
+        self.callback_on_edited()
         self.app.inform.emit(f'[success] {_("Tool added to DB.")}')
         self.app.inform.emit(f'[success] {_("Tool added to DB.")}')
 
 
-        # add the new entry to the Tools DB table
+    def on_tool_copy(self):
+        """
+        Copy a selection of Tools in the Tools DB table
+        :return:
+        """
+        new_tool_id = self.table_widget.rowCount() + 1
+        for model_index in self.table_widget.selectionModel().selectedRows():
+            # index = QtCore.QPersistentModelIndex(model_index)
+            old_tool_id = self.table_widget.item(model_index.row(), 0).text()
+            new_tool_id += 1
+
+            for toolid, dict_val in list(self.db_tool_dict.items()):
+                if int(old_tool_id) == int(toolid):
+                    self.db_tool_dict.update({
+                        new_tool_id: deepcopy(dict_val)
+                    })
+
         self.build_db_ui()
         self.build_db_ui()
         self.callback_on_edited()
         self.callback_on_edited()
+        self.app.inform.emit(f'[success] {_("Tool copied from Tools DB.")}')
 
 
-    def on_remove_entry(self):
+    def on_tool_delete(self):
         """
         """
-        Remove a Tool in the Tools DB table
+        Delete a selection of Tools in the Tools DB table
         :return:
         :return:
         """
         """
-        index_list = []
         for model_index in self.table_widget.selectionModel().selectedRows():
         for model_index in self.table_widget.selectionModel().selectedRows():
-            index = QtCore.QPersistentModelIndex(model_index)
-            index_list.append(index)
+            # index = QtCore.QPersistentModelIndex(model_index)
             toolname_to_remove = self.table_widget.item(model_index.row(), 0).text()
             toolname_to_remove = self.table_widget.item(model_index.row(), 0).text()
 
 
             for toolid, dict_val in list(self.db_tool_dict.items()):
             for toolid, dict_val in list(self.db_tool_dict.items()):
@@ -999,10 +1026,9 @@ class ToolsDB(QtWidgets.QWidget):
                     # remove from the storage
                     # remove from the storage
                     self.db_tool_dict.pop(toolid, None)
                     self.db_tool_dict.pop(toolid, None)
 
 
-        self.app.inform.emit(f'[success] {_("Tool removed from Tools DB.")}')
-
         self.build_db_ui()
         self.build_db_ui()
         self.callback_on_edited()
         self.callback_on_edited()
+        self.app.inform.emit(f'[success] {_("Tool removed from Tools DB.")}')
 
 
     def on_export_tools_db_file(self):
     def on_export_tools_db_file(self):
         self.app.report_usage("on_export_tools_db_file")
         self.app.report_usage("on_export_tools_db_file")
@@ -1038,7 +1064,7 @@ class ToolsDB(QtWidgets.QWidget):
                 self.app.log.debug('Creating a new Tools DB file ...')
                 self.app.log.debug('Creating a new Tools DB file ...')
                 f = open(filename, 'w')
                 f = open(filename, 'w')
                 f.close()
                 f.close()
-            except:
+            except Exception:
                 e = sys.exc_info()[0]
                 e = sys.exc_info()[0]
                 self.app.log.error("Could not load Tools DB file.")
                 self.app.log.error("Could not load Tools DB file.")
                 self.app.log.error(str(e))
                 self.app.log.error(str(e))
@@ -1055,7 +1081,7 @@ class ToolsDB(QtWidgets.QWidget):
                     self.app.log.debug("App.on_save_tools_db() --> %s" % str(e))
                     self.app.log.debug("App.on_save_tools_db() --> %s" % str(e))
                     self.inform.emit(f'[ERROR_NOTCL] {_("Failed to write Tools DB to file.")}')
                     self.inform.emit(f'[ERROR_NOTCL] {_("Failed to write Tools DB to file.")}')
                     return
                     return
-            except:
+            except Exception:
                 self.app.inform.emit('[ERROR_NOTCL] %s' % _("Failed to write Tools DB to file."))
                 self.app.inform.emit('[ERROR_NOTCL] %s' % _("Failed to write Tools DB to file."))
                 return
                 return
 
 
@@ -1081,7 +1107,7 @@ class ToolsDB(QtWidgets.QWidget):
 
 
             try:
             try:
                 self.db_tool_dict = json.loads(tools_in_db)
                 self.db_tool_dict = json.loads(tools_in_db)
-            except:
+            except Exception:
                 e = sys.exc_info()[0]
                 e = sys.exc_info()[0]
                 self.app.log.error(str(e))
                 self.app.log.error(str(e))
                 self.app.inform.emit('[ERROR] %s' % _("Failed to parse Tools DB file."))
                 self.app.inform.emit('[ERROR] %s' % _("Failed to parse Tools DB file."))
@@ -1112,7 +1138,7 @@ class ToolsDB(QtWidgets.QWidget):
                     return
                     return
 
 
                 if not silent:
                 if not silent:
-                    self.app.inform.emit('[success] %s: %s' % (_("Exported Tools DB to"), filename))
+                    self.app.inform.emit('[success] %s' % _("Saved Tools DB."))
 
 
     def ui_connect(self):
     def ui_connect(self):
         try:
         try:
@@ -1206,7 +1232,6 @@ class ToolsDB(QtWidgets.QWidget):
                 elif column_header_text == 'Tool Shape':
                 elif column_header_text == 'Tool Shape':
                     dict_elem['tool_type'] = self.table_widget.cellWidget(row, col).get_value()
                     dict_elem['tool_type'] = self.table_widget.cellWidget(row, col).get_value()
                 else:
                 else:
-
                     if column_header_text == 'Cut Z':
                     if column_header_text == 'Cut Z':
                         default_data['cutz'] = self.table_widget.cellWidget(row, col).get_value()
                         default_data['cutz'] = self.table_widget.cellWidget(row, col).get_value()
                     elif column_header_text == 'MultiDepth':
                     elif column_header_text == 'MultiDepth':
@@ -1261,19 +1286,15 @@ class ToolsDB(QtWidgets.QWidget):
         if not self.table_widget.selectionModel().selectedRows():
         if not self.table_widget.selectionModel().selectedRows():
             self.app.inform.emit('[WARNING_NOTCL] %s...' % _("No Tool/row selected in the Tools Database table"))
             self.app.inform.emit('[WARNING_NOTCL] %s...' % _("No Tool/row selected in the Tools Database table"))
             return
             return
-        elif len(self.table_widget.selectionModel().selectedRows()) > 1:
-            self.app.inform.emit('[WARNING_NOTCL] %s...' %
-                                 _("Only one tool can be selected in the Tools Database table"))
-            return
 
 
-        # only one model in list since the conditions above assure this
-        model_index = self.table_widget.selectionModel().selectedRows()[0]
-        selected_row = model_index.row()
-        tool_uid = selected_row + 1
-        for key in self.db_tool_dict.keys():
-            if str(key) == str(tool_uid):
-                selected_tool = self.db_tool_dict[key]
-                self.on_tool_request(tool=selected_tool)
+        model_index_list = self.table_widget.selectionModel().selectedRows()
+        for model_index in model_index_list:
+            selected_row = model_index.row()
+            tool_uid = selected_row + 1
+            for key in self.db_tool_dict.keys():
+                if str(key) == str(tool_uid):
+                    selected_tool = self.db_tool_dict[key]
+                    self.on_tool_request(tool=selected_tool)
 
 
     def resize_new_tool_table_widget(self, min_size, max_size):
     def resize_new_tool_table_widget(self, min_size, max_size):
         """
         """

+ 6 - 0
FlatCAMObj.py

@@ -3986,6 +3986,12 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
         and display the Tools Database tab in the form needed for the Tool adding
         and display the Tools Database tab in the form needed for the Tool adding
         :return: None
         :return: None
         """
         """
+
+        # if the Tools Database is already opened focus on it
+        for idx in range(self.app.ui.plot_tab_area.count()):
+            if self.app.ui.plot_tab_area.tabText(idx) == _("Tools Database"):
+                self.app.ui.plot_tab_area.setCurrentWidget(self.app.tools_db_tab)
+                break
         self.app.on_tools_database()
         self.app.on_tools_database()
         self.app.tools_db_tab.buttons_frame.hide()
         self.app.tools_db_tab.buttons_frame.hide()
         self.app.tools_db_tab.add_tool_from_db.show()
         self.app.tools_db_tab.add_tool_from_db.show()

+ 11 - 2
README.md

@@ -9,6 +9,15 @@ CAD program, and create G-Code for Isolation routing.
 
 
 =================================================
 =================================================
 
 
+11.11.2019
+
+- in Tools Database added a contextual menu to add/copy/delete tool; CTRL+C, DEL keys work too; key T for adding a tool is now only partially working
+- in Tools Database made the status bar messages show when adding/copying/deleting tools in DB
+- changed all Except statements that were single to except Exception as recommended in some PEP
+- renamed the Copper Fill Tool to Copper Thieving Tool as this is a more appropriate name; started to add ability for more types of copper thieving besides solid
+- fixed some issues recently introduced in ParseSVG
+- updated POT file
+
 9.11.2019
 9.11.2019
 
 
 - fixed a new bug that did not allow to open the FlatCAM Preferences files by doubleclick in Windows
 - fixed a new bug that did not allow to open the FlatCAM Preferences files by doubleclick in Windows
@@ -18,7 +27,7 @@ CAD program, and create G-Code for Isolation routing.
 
 
 8.11.2019
 8.11.2019
 
 
-- updated the make file for freezed executable
+- updated the make file for frozen executable
 
 
 7.11.2019
 7.11.2019
 
 
@@ -117,7 +126,7 @@ CAD program, and create G-Code for Isolation routing.
 - working on the Calibrate Excellon Tool
 - working on the Calibrate Excellon Tool
 - finished the GUI layout for the Calibrate Excellon Tool
 - finished the GUI layout for the Calibrate Excellon Tool
 - start working on QRCode Tool - not working yet
 - start working on QRCode Tool - not working yet
-- start working on QRCode Tool - searching for alternativess
+- start working on QRCode Tool - searching for alternatives
 
 
 21.10.2019
 21.10.2019
 
 

+ 7 - 5
camlib.py

@@ -1014,6 +1014,8 @@ class Geometry(object):
         :return: None
         :return: None
         """
         """
 
 
+        log.debug("camlib.Geometry.import_svg()")
+
         # Parse into list of shapely objects
         # Parse into list of shapely objects
         svg_tree = ET.parse(filename)
         svg_tree = ET.parse(filename)
         svg_root = svg_tree.getroot()
         svg_root = svg_tree.getroot()
@@ -1022,8 +1024,8 @@ class Geometry(object):
         # h = float(svg_root.get('height'))
         # h = float(svg_root.get('height'))
         # w = float(svg_root.get('width'))
         # w = float(svg_root.get('width'))
         h = svgparselength(svg_root.get('height'))[0]  # TODO: No units support yet
         h = svgparselength(svg_root.get('height'))[0]  # TODO: No units support yet
-        geos = getsvggeo(svg_root, object_type)
 
 
+        geos = getsvggeo(svg_root, object_type)
         if flip:
         if flip:
             geos = [translate(scale(g, 1.0, -1.0, origin=(0, 0)), yoff=h) for g in geos]
             geos = [translate(scale(g, 1.0, -1.0, origin=(0, 0)), yoff=h) for g in geos]
 
 
@@ -1134,12 +1136,12 @@ class Geometry(object):
 
 
             try:
             try:
                 green = src.read(2)
                 green = src.read(2)
-            except Exception as e:
+            except Exception:
                 pass
                 pass
 
 
             try:
             try:
                 blue = src.read(3)
                 blue = src.read(3)
-            except Exception as e:
+            except Exception:
                 pass
                 pass
 
 
         if mode == 'black':
         if mode == 'black':
@@ -2289,7 +2291,7 @@ class CNCjob(Geometry):
         try:
         try:
             returnvalue = fun(attributes)
             returnvalue = fun(attributes)
             return returnvalue
             return returnvalue
-        except Exception as e:
+        except Exception:
             self.app.log.error('Exception occurred within a postprocessor: ' + traceback.format_exc())
             self.app.log.error('Exception occurred within a postprocessor: ' + traceback.format_exc())
             return ''
             return ''
 
 
@@ -5192,7 +5194,7 @@ def get_bounds(geometry_list):
             ymin = min([ymin, gymin])
             ymin = min([ymin, gymin])
             xmax = max([xmax, gxmax])
             xmax = max([xmax, gxmax])
             ymax = max([ymax, gymax])
             ymax = max([ymax, gymax])
-        except:
+        except Exception:
             log.warning("DEVELOPMENT: Tried to get bounds of empty geometry.")
             log.warning("DEVELOPMENT: Tried to get bounds of empty geometry.")
 
 
     return [xmin, ymin, xmax, ymax]
     return [xmin, ymin, xmax, ymax]

+ 4 - 4
flatcamEditors/FlatCAMExcEditor.py

@@ -63,7 +63,7 @@ class FCDrillAdd(FCShapeTool):
 
 
         try:
         try:
             QtGui.QGuiApplication.restoreOverrideCursor()
             QtGui.QGuiApplication.restoreOverrideCursor()
-        except Exception as e:
+        except Exception:
             pass
             pass
         self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_drill.png'))
         self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_drill.png'))
         QtGui.QGuiApplication.setOverrideCursor(self.cursor)
         QtGui.QGuiApplication.setOverrideCursor(self.cursor)
@@ -105,7 +105,7 @@ class FCDrillAdd(FCShapeTool):
 
 
         try:
         try:
             QtGui.QGuiApplication.restoreOverrideCursor()
             QtGui.QGuiApplication.restoreOverrideCursor()
-        except Exception as e:
+        except Exception:
             pass
             pass
 
 
         # add the point to drills if the diameter is a key in the dict, if not, create it add the drill location
         # add the point to drills if the diameter is a key in the dict, if not, create it add the drill location
@@ -888,7 +888,7 @@ class FCDrillResize(FCShapeTool):
 
 
         try:
         try:
             new_dia = self.draw_app.resdrill_entry.get_value()
             new_dia = self.draw_app.resdrill_entry.get_value()
-        except:
+        except Exception:
             self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' %
             self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' %
                                           _("Resize drill(s) failed. Please enter a diameter for resize."))
                                           _("Resize drill(s) failed. Please enter a diameter for resize."))
             return
             return
@@ -3241,7 +3241,7 @@ class FlatCAMExcEditor(QtCore.QObject):
                 self.app.inform.emit('[ERROR_NOTCL] %s' %
                 self.app.inform.emit('[ERROR_NOTCL] %s' %
                                      _("There are no Tools definitions in the file. Aborting Excellon creation.")
                                      _("There are no Tools definitions in the file. Aborting Excellon creation.")
                                      )
                                      )
-            except:
+            except Exception:
                 msg = '[ERROR] %s' % \
                 msg = '[ERROR] %s' % \
                       _("An internal error has ocurred. See Shell.\n")
                       _("An internal error has ocurred. See Shell.\n")
                 msg += traceback.format_exc()
                 msg += traceback.format_exc()

+ 16 - 21
flatcamEditors/FlatCAMGeoEditor.py

@@ -1297,8 +1297,7 @@ class TransformEditorTool(FlatCAMTool):
                     self.app.progress.emit(100)
                     self.app.progress.emit(100)
 
 
                 except Exception as e:
                 except Exception as e:
-                    self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
-                                         (_("Rotation action was not executed"), str(e)))
+                    self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Rotation action was not executed"), str(e)))
                     return
                     return
 
 
     def on_flip(self, axis):
     def on_flip(self, axis):
@@ -1358,8 +1357,7 @@ class TransformEditorTool(FlatCAMTool):
                     self.app.progress.emit(100)
                     self.app.progress.emit(100)
 
 
                 except Exception as e:
                 except Exception as e:
-                    self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
-                                         (_("Flip action was not executed"), str(e)))
+                    self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Flip action was not executed"), str(e)))
                     return
                     return
 
 
     def on_skew(self, axis, num):
     def on_skew(self, axis, num):
@@ -1405,8 +1403,7 @@ class TransformEditorTool(FlatCAMTool):
                     self.app.progress.emit(100)
                     self.app.progress.emit(100)
 
 
                 except Exception as e:
                 except Exception as e:
-                    self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
-                                         (_("Skew action was not executed"), str(e)))
+                    self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Skew action was not executed"), str(e)))
                     return
                     return
 
 
     def on_scale(self, axis, xfactor, yfactor, point=None):
     def on_scale(self, axis, xfactor, yfactor, point=None):
@@ -1462,8 +1459,7 @@ class TransformEditorTool(FlatCAMTool):
                                              _('Scale on the Y axis done'))
                                              _('Scale on the Y axis done'))
                     self.app.progress.emit(100)
                     self.app.progress.emit(100)
                 except Exception as e:
                 except Exception as e:
-                    self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
-                                         (_("Scale action was not executed"), str(e)))
+                    self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Scale action was not executed"), str(e)))
                     return
                     return
 
 
     def on_offset(self, axis, num):
     def on_offset(self, axis, num):
@@ -1496,8 +1492,7 @@ class TransformEditorTool(FlatCAMTool):
                     self.app.progress.emit(100)
                     self.app.progress.emit(100)
 
 
                 except Exception as e:
                 except Exception as e:
-                    self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
-                                         (_("Offset action was not executed"), str(e)))
+                    self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Offset action was not executed"), str(e)))
                     return
                     return
 
 
     def on_rotate_key(self):
     def on_rotate_key(self):
@@ -1815,7 +1810,7 @@ class DrawToolShape(object):
 
 
         try:
         try:
             xfactor = float(xfactor)
             xfactor = float(xfactor)
-        except:
+        except Exception:
             log.debug("DrawToolShape.offset() --> Scale factor has to be a number: integer or float.")
             log.debug("DrawToolShape.offset() --> Scale factor has to be a number: integer or float.")
             return
             return
 
 
@@ -1824,7 +1819,7 @@ class DrawToolShape(object):
         else:
         else:
             try:
             try:
                 yfactor = float(yfactor)
                 yfactor = float(yfactor)
-            except:
+            except Exception:
                 log.debug("DrawToolShape.offset() --> Scale factor has to be a number: integer or float.")
                 log.debug("DrawToolShape.offset() --> Scale factor has to be a number: integer or float.")
                 return
                 return
 
 
@@ -1946,7 +1941,7 @@ class FCCircle(FCShapeTool):
 
 
         try:
         try:
             QtGui.QGuiApplication.restoreOverrideCursor()
             QtGui.QGuiApplication.restoreOverrideCursor()
-        except Exception as e:
+        except Exception:
             pass
             pass
         self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_circle_geo.png'))
         self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_circle_geo.png'))
         QtGui.QGuiApplication.setOverrideCursor(self.cursor)
         QtGui.QGuiApplication.setOverrideCursor(self.cursor)
@@ -1979,7 +1974,7 @@ class FCCircle(FCShapeTool):
     def make(self):
     def make(self):
         try:
         try:
             QtGui.QGuiApplication.restoreOverrideCursor()
             QtGui.QGuiApplication.restoreOverrideCursor()
-        except Exception as e:
+        except Exception:
             pass
             pass
 
 
         p1 = self.points[0]
         p1 = self.points[0]
@@ -1998,7 +1993,7 @@ class FCArc(FCShapeTool):
 
 
         try:
         try:
             QtGui.QGuiApplication.restoreOverrideCursor()
             QtGui.QGuiApplication.restoreOverrideCursor()
-        except Exception as e:
+        except Exception:
             pass
             pass
         self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_arc.png'))
         self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_arc.png'))
         QtGui.QGuiApplication.setOverrideCursor(self.cursor)
         QtGui.QGuiApplication.setOverrideCursor(self.cursor)
@@ -2217,7 +2212,7 @@ class FCRectangle(FCShapeTool):
 
 
         try:
         try:
             QtGui.QGuiApplication.restoreOverrideCursor()
             QtGui.QGuiApplication.restoreOverrideCursor()
-        except Exception as e:
+        except Exception:
             pass
             pass
         self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero.png'))
         self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero.png'))
         QtGui.QGuiApplication.setOverrideCursor(self.cursor)
         QtGui.QGuiApplication.setOverrideCursor(self.cursor)
@@ -2248,7 +2243,7 @@ class FCRectangle(FCShapeTool):
     def make(self):
     def make(self):
         try:
         try:
             QtGui.QGuiApplication.restoreOverrideCursor()
             QtGui.QGuiApplication.restoreOverrideCursor()
-        except Exception as e:
+        except Exception:
             pass
             pass
 
 
         p1 = self.points[0]
         p1 = self.points[0]
@@ -2271,7 +2266,7 @@ class FCPolygon(FCShapeTool):
 
 
         try:
         try:
             QtGui.QGuiApplication.restoreOverrideCursor()
             QtGui.QGuiApplication.restoreOverrideCursor()
-        except Exception as e:
+        except Exception:
             pass
             pass
         self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero.png'))
         self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero.png'))
         QtGui.QGuiApplication.setOverrideCursor(self.cursor)
         QtGui.QGuiApplication.setOverrideCursor(self.cursor)
@@ -2304,7 +2299,7 @@ class FCPolygon(FCShapeTool):
     def make(self):
     def make(self):
         try:
         try:
             QtGui.QGuiApplication.restoreOverrideCursor()
             QtGui.QGuiApplication.restoreOverrideCursor()
-        except Exception as e:
+        except Exception:
             pass
             pass
 
 
         # self.geometry = LinearRing(self.points)
         # self.geometry = LinearRing(self.points)
@@ -2334,7 +2329,7 @@ class FCPath(FCPolygon):
 
 
         try:
         try:
             QtGui.QGuiApplication.restoreOverrideCursor()
             QtGui.QGuiApplication.restoreOverrideCursor()
-        except Exception as e:
+        except Exception:
             pass
             pass
         self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_path5.png'))
         self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_path5.png'))
         QtGui.QGuiApplication.setOverrideCursor(self.cursor)
         QtGui.QGuiApplication.setOverrideCursor(self.cursor)
@@ -2748,7 +2743,7 @@ class FCText(FCShapeTool):
 
 
         try:
         try:
             return DrawToolUtilityShape(affinity.translate(self.text_gui.text_path, xoff=dx, yoff=dy))
             return DrawToolUtilityShape(affinity.translate(self.text_gui.text_path, xoff=dx, yoff=dy))
-        except:
+        except Exception:
             return
             return
 
 
 
 

+ 27 - 4
flatcamGUI/FlatCAMGUI.py

@@ -748,7 +748,8 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
         self.calculators_btn = self.toolbartools.addAction(QtGui.QIcon('share/calculator24.png'), _("Calculators Tool"))
         self.calculators_btn = self.toolbartools.addAction(QtGui.QIcon('share/calculator24.png'), _("Calculators Tool"))
         self.transform_btn = self.toolbartools.addAction(QtGui.QIcon('share/transform.png'), _("Transform Tool"))
         self.transform_btn = self.toolbartools.addAction(QtGui.QIcon('share/transform.png'), _("Transform Tool"))
         self.qrcode_btn = self.toolbartools.addAction(QtGui.QIcon('share/qrcode32.png'), _("QRCode Tool"))
         self.qrcode_btn = self.toolbartools.addAction(QtGui.QIcon('share/qrcode32.png'), _("QRCode Tool"))
-        self.copperfill_btn = self.toolbartools.addAction(QtGui.QIcon('share/copperfill32.png'), _("Copper Fill Tool"))
+        self.copperfill_btn = self.toolbartools.addAction(QtGui.QIcon('share/copperfill32.png'),
+                                                          _("Copper Thieving Tool"))
 
 
         # ########################################################################
         # ########################################################################
         # ########################## Excellon Editor Toolbar# ####################
         # ########################## Excellon Editor Toolbar# ####################
@@ -2173,7 +2174,8 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
                                                            _("Calculators Tool"))
                                                            _("Calculators Tool"))
         self.transform_btn = self.toolbartools.addAction(QtGui.QIcon('share/transform.png'), _("Transform Tool"))
         self.transform_btn = self.toolbartools.addAction(QtGui.QIcon('share/transform.png'), _("Transform Tool"))
         self.qrcode_btn = self.toolbartools.addAction(QtGui.QIcon('share/qrcode32.png'), _("QRCode Tool"))
         self.qrcode_btn = self.toolbartools.addAction(QtGui.QIcon('share/qrcode32.png'), _("QRCode Tool"))
-        self.copperfill_btn = self.toolbartools.addAction(QtGui.QIcon('share/copperfill32.png'), _("Copper Fill Tool"))
+        self.copperfill_btn = self.toolbartools.addAction(QtGui.QIcon('share/copperfill32.png'),
+                                                          _("Copper Thieving Tool"))
 
 
         # ## Excellon Editor Toolbar # ##
         # ## Excellon Editor Toolbar # ##
         self.select_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), _("Select"))
         self.select_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), _("Select"))
@@ -2378,6 +2380,13 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
 
 
                 # Copy an FlatCAM object
                 # Copy an FlatCAM object
                 if key == QtCore.Qt.Key_C:
                 if key == QtCore.Qt.Key_C:
+                    widget_name = self.plot_tab_area.currentWidget().objectName()
+                    if widget_name == 'database_tab':
+                        # Tools DB saved, update flag
+                        self.app.tools_db_changed_flag = True
+                        self.app.tools_db_tab.on_tool_copy()
+                        return
+
                     self.app.on_copy_object()
                     self.app.on_copy_object()
 
 
                 # Copy an FlatCAM object
                 # Copy an FlatCAM object
@@ -2504,7 +2513,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
                     self.app.cal_exc_tool.run(toggle=True)
                     self.app.cal_exc_tool.run(toggle=True)
                     return
                     return
 
 
-                # Copper Fill Tool
+                # Copper Thieving Tool
                 if key == QtCore.Qt.Key_F:
                 if key == QtCore.Qt.Key_F:
                     self.app.copperfill_tool.run(toggle=True)
                     self.app.copperfill_tool.run(toggle=True)
                     return
                     return
@@ -2611,6 +2620,13 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
                 # It's meant to make a difference between delete objects and delete tools in
                 # It's meant to make a difference between delete objects and delete tools in
                 # Geometry Selected tool table
                 # Geometry Selected tool table
                 if key == QtCore.Qt.Key_Delete and matplotlib_key_flag is False:
                 if key == QtCore.Qt.Key_Delete and matplotlib_key_flag is False:
+                    widget_name = self.plot_tab_area.currentWidget().objectName()
+                    if widget_name == 'database_tab':
+                        # Tools DB saved, update flag
+                        self.app.tools_db_changed_flag = True
+                        self.app.tools_db_tab.on_tool_delete()
+                        return
+
                     self.app.on_delete_keypress()
                     self.app.on_delete_keypress()
 
 
                 # Delete from canvas
                 # Delete from canvas
@@ -2703,6 +2719,13 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
 
 
                 # Add a Tool from shortcut
                 # Add a Tool from shortcut
                 if key == QtCore.Qt.Key_T:
                 if key == QtCore.Qt.Key_T:
+                    widget_name = self.plot_tab_area.currentWidget().objectName()
+                    if widget_name == 'database_tab':
+                        # Tools DB saved, update flag
+                        self.app.tools_db_changed_flag = True
+                        self.app.tools_db_tab.on_tool_add()
+                        return
+
                     self.app.on_tool_add_keypress()
                     self.app.on_tool_add_keypress()
 
 
                 # Zoom Fit
                 # Zoom Fit
@@ -3509,7 +3532,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
                 # Jump to coords
                 # Jump to coords
                 if key == QtCore.Qt.Key_J:
                 if key == QtCore.Qt.Key_J:
                     self.app.on_jump_to()
                     self.app.on_jump_to()
-        elif self.app.call_source == 'copperfill_tool':
+        elif self.app.call_source == 'copper_thieving_tool':
             if modifiers == QtCore.Qt.ControlModifier | QtCore.Qt.AltModifier:
             if modifiers == QtCore.Qt.ControlModifier | QtCore.Qt.AltModifier:
                 if key == QtCore.Qt.Key_X:
                 if key == QtCore.Qt.Key_X:
                     self.app.abort_all_tasks()
                     self.app.abort_all_tasks()

+ 1 - 1
flatcamGUI/GUIElements.py

@@ -199,7 +199,7 @@ class LengthEntry(QtWidgets.QLineEdit):
         except KeyError:
         except KeyError:
             value = raw
             value = raw
             return float(eval(value))
             return float(eval(value))
-        except:
+        except Exception:
             log.warning("Could not parse value in entry: %s" % str(raw))
             log.warning("Could not parse value in entry: %s" % str(raw))
             return None
             return None
 
 

+ 2 - 2
flatcamGUI/PlotCanvas.py

@@ -161,7 +161,7 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
             self.r_line.parent = None
             self.r_line.parent = None
             self.t_line.parent = None
             self.t_line.parent = None
             self.l_line.parent = None
             self.l_line.parent = None
-        except Exception as e:
+        except Exception:
             pass
             pass
 
 
     # redraw the workspace lines on the plot by readding them to the parent view.scene
     # redraw the workspace lines on the plot by readding them to the parent view.scene
@@ -171,7 +171,7 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
             self.r_line.parent = self.view.scene
             self.r_line.parent = self.view.scene
             self.t_line.parent = self.view.scene
             self.t_line.parent = self.view.scene
             self.l_line.parent = self.view.scene
             self.l_line.parent = self.view.scene
-        except Exception as e:
+        except Exception:
             pass
             pass
 
 
     def graph_event_connect(self, event_name, callback):
     def graph_event_connect(self, event_name, callback):

+ 36 - 13
flatcamGUI/PreferencesUI.py

@@ -5568,10 +5568,10 @@ class Tools2QRCodePrefGroupUI(OptionsGroupUI):
         self.error_label = QtWidgets.QLabel('%s:' % _("Error correction"))
         self.error_label = QtWidgets.QLabel('%s:' % _("Error correction"))
         self.error_label.setToolTip(
         self.error_label.setToolTip(
             _("Parameter that controls the error correction used for the QR Code.\n"
             _("Parameter that controls the error correction used for the QR Code.\n"
-              "L = maximum 7% errors can be corrected\n"
-              "M = maximum 15% errors can be corrected\n"
-              "Q = maximum 25% errors can be corrected\n"
-              "H = maximum 30% errors can be corrected.")
+              "L = maximum 7%% errors can be corrected\n"
+              "M = maximum 15%% errors can be corrected\n"
+              "Q = maximum 25%% errors can be corrected\n"
+              "H = maximum 30%% errors can be corrected.")
         )
         )
         self.error_radio = RadioSet([{'label': 'L', 'value': 'L'},
         self.error_radio = RadioSet([{'label': 'L', 'value': 'L'},
                                      {'label': 'M', 'value': 'M'},
                                      {'label': 'M', 'value': 'M'},
@@ -5579,10 +5579,10 @@ class Tools2QRCodePrefGroupUI(OptionsGroupUI):
                                      {'label': 'H', 'value': 'H'}])
                                      {'label': 'H', 'value': 'H'}])
         self.error_radio.setToolTip(
         self.error_radio.setToolTip(
             _("Parameter that controls the error correction used for the QR Code.\n"
             _("Parameter that controls the error correction used for the QR Code.\n"
-              "L = maximum 7% errors can be corrected\n"
-              "M = maximum 15% errors can be corrected\n"
-              "Q = maximum 25% errors can be corrected\n"
-              "H = maximum 30% errors can be corrected.")
+              "L = maximum 7%% errors can be corrected\n"
+              "M = maximum 15%% errors can be corrected\n"
+              "Q = maximum 25%% errors can be corrected\n"
+              "H = maximum 30%% errors can be corrected.")
         )
         )
         grid_lay.addWidget(self.error_label, 2, 0)
         grid_lay.addWidget(self.error_label, 2, 0)
         grid_lay.addWidget(self.error_radio, 2, 1)
         grid_lay.addWidget(self.error_radio, 2, 1)
@@ -5722,7 +5722,7 @@ class Tools2CFillPrefGroupUI(OptionsGroupUI):
 
 
         super(Tools2CFillPrefGroupUI, self).__init__(self)
         super(Tools2CFillPrefGroupUI, self).__init__(self)
 
 
-        self.setTitle(str(_("Copper Fill Tool Options")))
+        self.setTitle(str(_("Copper Thieving Tool Options")))
         self.decimals = 4
         self.decimals = 4
 
 
         # ## Grid Layout
         # ## Grid Layout
@@ -5734,7 +5734,7 @@ class Tools2CFillPrefGroupUI(OptionsGroupUI):
         # ## Parameters
         # ## Parameters
         self.cflabel = QtWidgets.QLabel('<b>%s</b>' % _('Parameters'))
         self.cflabel = QtWidgets.QLabel('<b>%s</b>' % _('Parameters'))
         self.cflabel.setToolTip(
         self.cflabel.setToolTip(
-            _("A tool to generate a Copper fill that can be added\n"
+            _("A tool to generate a Copper Thieving that can be added\n"
               "to a selected Gerber file.")
               "to a selected Gerber file.")
         )
         )
         grid_lay.addWidget(self.cflabel, 0, 0, 1, 2)
         grid_lay.addWidget(self.cflabel, 0, 0, 1, 2)
@@ -5754,7 +5754,7 @@ class Tools2CFillPrefGroupUI(OptionsGroupUI):
         # CLEARANCE #
         # CLEARANCE #
         self.clearance_label = QtWidgets.QLabel('%s:' % _("Clearance"))
         self.clearance_label = QtWidgets.QLabel('%s:' % _("Clearance"))
         self.clearance_label.setToolTip(
         self.clearance_label.setToolTip(
-            _("This set the distance between the copper fill components\n"
+            _("This set the distance between the copper Thieving components\n"
               "(the polygon fill may be split in multiple polygons)\n"
               "(the polygon fill may be split in multiple polygons)\n"
               "and the copper traces in the Gerber file.")
               "and the copper traces in the Gerber file.")
         )
         )
@@ -5787,9 +5787,9 @@ class Tools2CFillPrefGroupUI(OptionsGroupUI):
         ], orientation='vertical', stretch=False)
         ], orientation='vertical', stretch=False)
         self.reference_label = QtWidgets.QLabel(_("Reference:"))
         self.reference_label = QtWidgets.QLabel(_("Reference:"))
         self.reference_label.setToolTip(
         self.reference_label.setToolTip(
-            _("- 'Itself' - the copper fill extent is based on the object that is copper cleared.\n "
+            _("- 'Itself' - the copper Thieving extent is based on the object that is copper cleared.\n "
               "- 'Area Selection' - left mouse click to start selection of the area to be filled.\n"
               "- 'Area Selection' - left mouse click to start selection of the area to be filled.\n"
-              "- 'Reference Object' - will do copper filling within the area specified by another object.")
+              "- 'Reference Object' - will do copper thieving within the area specified by another object.")
         )
         )
         grid_lay.addWidget(self.reference_label, 4, 0)
         grid_lay.addWidget(self.reference_label, 4, 0)
         grid_lay.addWidget(self.reference_radio, 4, 1)
         grid_lay.addWidget(self.reference_radio, 4, 1)
@@ -5807,6 +5807,29 @@ class Tools2CFillPrefGroupUI(OptionsGroupUI):
         grid_lay.addWidget(self.bbox_type_label, 5, 0)
         grid_lay.addWidget(self.bbox_type_label, 5, 0)
         grid_lay.addWidget(self.bbox_type_radio, 5, 1)
         grid_lay.addWidget(self.bbox_type_radio, 5, 1)
 
 
+
+        separator_line = QtWidgets.QFrame()
+        separator_line.setFrameShape(QtWidgets.QFrame.HLine)
+        separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
+        grid_lay.addWidget(separator_line, 6, 0, 1, 2)
+
+        # Fill Type
+        self.fill_type_radio = RadioSet([
+            {'label': _('Solid'), 'value': 'solid'},
+            {"label": _("Dots Grid"), "value": "dot"},
+            {"label": _("Squares Grid"), "value": "square"},
+            {"label": _("Lines Grid"), "value": "line"}
+        ], orientation='vertical', stretch=False)
+        self.fill_type_label = QtWidgets.QLabel(_("Fill Type:"))
+        self.fill_type_label.setToolTip(
+            _("- 'Solid' - copper thieving will be a solid polygon.\n "
+              "- 'Dots Grid' - the empty area will be filled with a pattern of dots.\n"
+              "- 'Squares Grid' - the empty area will be filled with a pattern of squares.\n"
+              "- 'Lines Grid' - the empty area will be filled with a pattern of lines.")
+        )
+        grid_lay.addWidget(self.fill_type_label, 7, 0)
+        grid_lay.addWidget(self.fill_type_radio, 7, 1)
+
         self.layout.addStretch()
         self.layout.addStretch()
 
 
 
 

+ 2 - 2
flatcamParsers/ParseDXF.py

@@ -241,7 +241,7 @@ def dxfsolid2shapely(solid):
     try:
     try:
         corner_list.append(solid[iterator])
         corner_list.append(solid[iterator])
         iterator += 1
         iterator += 1
-    except:
+    except Exception:
         return Polygon(corner_list)
         return Polygon(corner_list)
 
 
 
 
@@ -265,7 +265,7 @@ def dxftrace2shapely(trace):
     try:
     try:
         corner_list.append(trace[iterator])
         corner_list.append(trace[iterator])
         iterator += 1
         iterator += 1
-    except:
+    except Exception:
         return Polygon(corner_list)
         return Polygon(corner_list)
 
 
 
 

+ 12 - 12
flatcamParsers/ParseExcellon.py

@@ -250,7 +250,7 @@ class Excellon(Geometry):
 
 
         try:
         try:
             self.parse_lines(estr)
             self.parse_lines(estr)
-        except:
+        except Exception:
             return "fail"
             return "fail"
 
 
     def parse_lines(self, elines):
     def parse_lines(self, elines):
@@ -412,7 +412,7 @@ class Excellon(Geometry):
                                 name = str(int(match.group(1)))
                                 name = str(int(match.group(1)))
                                 try:
                                 try:
                                     diam = float(match.group(2))
                                     diam = float(match.group(2))
-                                except:
+                                except Exception:
                                     # it's possible that tool definition has only tool number and no diameter info
                                     # it's possible that tool definition has only tool number and no diameter info
                                     # (those could be in another file like PCB Wizard do)
                                     # (those could be in another file like PCB Wizard do)
                                     # then match.group(2) = None and float(None) will create the exception
                                     # then match.group(2) = None and float(None) will create the exception
@@ -476,7 +476,7 @@ class Excellon(Geometry):
                                 slot_current_x = slot_start_x
                                 slot_current_x = slot_start_x
                             except TypeError:
                             except TypeError:
                                 slot_start_x = slot_current_x
                                 slot_start_x = slot_current_x
-                            except:
+                            except Exception:
                                 return
                                 return
 
 
                             try:
                             try:
@@ -484,7 +484,7 @@ class Excellon(Geometry):
                                 slot_current_y = slot_start_y
                                 slot_current_y = slot_start_y
                             except TypeError:
                             except TypeError:
                                 slot_start_y = slot_current_y
                                 slot_start_y = slot_current_y
-                            except:
+                            except Exception:
                                 return
                                 return
 
 
                             try:
                             try:
@@ -492,7 +492,7 @@ class Excellon(Geometry):
                                 slot_current_x = slot_stop_x
                                 slot_current_x = slot_stop_x
                             except TypeError:
                             except TypeError:
                                 slot_stop_x = slot_current_x
                                 slot_stop_x = slot_current_x
-                            except:
+                            except Exception:
                                 return
                                 return
 
 
                             try:
                             try:
@@ -500,7 +500,7 @@ class Excellon(Geometry):
                                 slot_current_y = slot_stop_y
                                 slot_current_y = slot_stop_y
                             except TypeError:
                             except TypeError:
                                 slot_stop_y = slot_current_y
                                 slot_stop_y = slot_current_y
-                            except:
+                            except Exception:
                                 return
                                 return
 
 
                             if (slot_start_x is None or slot_start_y is None or
                             if (slot_start_x is None or slot_start_y is None or
@@ -546,7 +546,7 @@ class Excellon(Geometry):
                                 slot_current_x = slot_start_x
                                 slot_current_x = slot_start_x
                             except TypeError:
                             except TypeError:
                                 slot_start_x = slot_current_x
                                 slot_start_x = slot_current_x
-                            except:
+                            except Exception:
                                 return
                                 return
 
 
                             try:
                             try:
@@ -554,7 +554,7 @@ class Excellon(Geometry):
                                 slot_current_y = slot_start_y
                                 slot_current_y = slot_start_y
                             except TypeError:
                             except TypeError:
                                 slot_start_y = slot_current_y
                                 slot_start_y = slot_current_y
-                            except:
+                            except Exception:
                                 return
                                 return
 
 
                             try:
                             try:
@@ -562,7 +562,7 @@ class Excellon(Geometry):
                                 slot_current_x = slot_stop_x
                                 slot_current_x = slot_stop_x
                             except TypeError:
                             except TypeError:
                                 slot_stop_x = slot_current_x
                                 slot_stop_x = slot_current_x
-                            except:
+                            except Exception:
                                 return
                                 return
 
 
                             try:
                             try:
@@ -570,7 +570,7 @@ class Excellon(Geometry):
                                 slot_current_y = slot_stop_y
                                 slot_current_y = slot_stop_y
                             except TypeError:
                             except TypeError:
                                 slot_stop_y = slot_current_y
                                 slot_stop_y = slot_current_y
-                            except:
+                            except Exception:
                                 return
                                 return
 
 
                             if (slot_start_x is None or slot_start_y is None or
                             if (slot_start_x is None or slot_start_y is None or
@@ -619,7 +619,7 @@ class Excellon(Geometry):
                         except TypeError:
                         except TypeError:
                             x = current_x
                             x = current_x
                             repeating_x = 0
                             repeating_x = 0
-                        except:
+                        except Exception:
                             return
                             return
 
 
                         try:
                         try:
@@ -629,7 +629,7 @@ class Excellon(Geometry):
                         except TypeError:
                         except TypeError:
                             y = current_y
                             y = current_y
                             repeating_y = 0
                             repeating_y = 0
-                        except:
+                        except Exception:
                             return
                             return
 
 
                         if x is None or y is None:
                         if x is None or y is None:

+ 6 - 6
flatcamParsers/ParseGerber.py

@@ -258,7 +258,7 @@ class Gerber(Geometry):
 
 
         try:  # Could be empty for aperture macros
         try:  # Could be empty for aperture macros
             paramList = apParameters.split('X')
             paramList = apParameters.split('X')
-        except:
+        except Exception:
             paramList = None
             paramList = None
 
 
         if apertureType == "C":  # Circle, example: %ADD11C,0.1*%
         if apertureType == "C":  # Circle, example: %ADD11C,0.1*%
@@ -867,7 +867,7 @@ class Gerber(Geometry):
                     # if match.group(1) is None and match.group(2) is None and match.group(3) is None:
                     # if match.group(1) is None and match.group(2) is None and match.group(3) is None:
                     #     try:
                     #     try:
                     #         current_operation_code = int(match.group(4))
                     #         current_operation_code = int(match.group(4))
-                    #     except:
+                    #     except Exception:
                     #         pass  # A line with just * will match too.
                     #         pass  # A line with just * will match too.
                     #     continue
                     #     continue
                     # NOTE: Letting it continue allows it to react to the
                     # NOTE: Letting it continue allows it to react to the
@@ -1082,7 +1082,7 @@ class Gerber(Geometry):
                                             geo_dict['clear'] = geo_s
                                             geo_dict['clear'] = geo_s
                                         else:
                                         else:
                                             geo_dict['solid'] = geo_s
                                             geo_dict['solid'] = geo_s
-                                except:
+                                except Exception:
                                     if self.app.defaults['gerber_simplification']:
                                     if self.app.defaults['gerber_simplification']:
                                         poly_buffer.append(geo_s.simplify(s_tol))
                                         poly_buffer.append(geo_s.simplify(s_tol))
                                     else:
                                     else:
@@ -1434,7 +1434,7 @@ class Gerber(Geometry):
                 #     for poly in new_poly:
                 #     for poly in new_poly:
                 #         try:
                 #         try:
                 #             self.solid_geometry = self.solid_geometry.union(poly)
                 #             self.solid_geometry = self.solid_geometry.union(poly)
-                #         except:
+                #         except Exception:
                 #             pass
                 #             pass
             else:
             else:
                 self.solid_geometry = self.solid_geometry.difference(new_poly)
                 self.solid_geometry = self.solid_geometry.difference(new_poly)
@@ -1661,7 +1661,7 @@ class Gerber(Geometry):
 
 
         try:
         try:
             xfactor = float(xfactor)
             xfactor = float(xfactor)
-        except:
+        except Exception:
             self.app.inform.emit('[ERROR_NOTCL] %s' %
             self.app.inform.emit('[ERROR_NOTCL] %s' %
                                  _("Scale factor has to be a number: integer or float."))
                                  _("Scale factor has to be a number: integer or float."))
             return
             return
@@ -1671,7 +1671,7 @@ class Gerber(Geometry):
         else:
         else:
             try:
             try:
                 yfactor = float(yfactor)
                 yfactor = float(yfactor)
-            except:
+            except Exception:
                 self.app.inform.emit('[ERROR_NOTCL] %s' %
                 self.app.inform.emit('[ERROR_NOTCL] %s' %
                                      _("Scale factor has to be a number: integer or float."))
                                      _("Scale factor has to be a number: integer or float."))
                 return
                 return

+ 2 - 2
flatcamParsers/ParseSVG.py

@@ -125,7 +125,7 @@ def path2shapely(path, object_type, res=1.0):
 
 
     rings = MultiLineString(rings)
     rings = MultiLineString(rings)
     if len(rings) > 0:
     if len(rings) > 0:
-        if len(rings) == 1:
+        if len(rings) == 1 and not isinstance(rings, MultiLineString):
             # Polygons are closed and require more than 2 points
             # Polygons are closed and require more than 2 points
             if Point(rings[0][0]).almost_equals(Point(rings[0][-1])) and len(rings[0]) > 2:
             if Point(rings[0][0]).almost_equals(Point(rings[0][-1])) and len(rings[0]) > 2:
                 geo_element = Polygon(rings[0])
                 geo_element = Polygon(rings[0])
@@ -134,7 +134,7 @@ def path2shapely(path, object_type, res=1.0):
         else:
         else:
             try:
             try:
                 geo_element = Polygon(rings[0], rings[1:])
                 geo_element = Polygon(rings[0], rings[1:])
-            except Exception as e:
+            except Exception:
                 coords = list()
                 coords = list()
                 for line in rings:
                 for line in rings:
                     coords.append(line.coords[0])
                     coords.append(line.coords[0])

+ 1 - 1
flatcamTools/ToolCalibrateExcellon.py

@@ -423,7 +423,7 @@ class ToolCalibrateExcellon(FlatCAMTool):
         # ## Adjust Objects Button
         # ## Adjust Objects Button
         self.adj_obj_button = QtWidgets.QPushButton(_("Adjust Objects"))
         self.adj_obj_button = QtWidgets.QPushButton(_("Adjust Objects"))
         self.adj_obj_button.setToolTip(
         self.adj_obj_button.setToolTip(
-            _("Adjust (scale and / or skew) the objects\n"
+            _("Adjust (scale and/or skew) the objects\n"
               "with the factors determined above.")
               "with the factors determined above.")
         )
         )
         grid_lay.addWidget(self.adj_obj_button, 34, 0, 1, 3)
         grid_lay.addWidget(self.adj_obj_button, 34, 0, 1, 3)

+ 57 - 35
flatcamTools/ToolCopperFill.py → flatcamTools/ToolCopperThieving.py

@@ -33,9 +33,9 @@ if '_' not in builtins.__dict__:
 log = logging.getLogger('base')
 log = logging.getLogger('base')
 
 
 
 
-class ToolCopperFill(FlatCAMTool):
+class ToolCopperThieving(FlatCAMTool):
 
 
-    toolName = _("Copper Fill Tool")
+    toolName = _("Copper Thieving Tool")
 
 
     def __init__(self, app):
     def __init__(self, app):
         FlatCAMTool.__init__(self, app)
         FlatCAMTool.__init__(self, app)
@@ -71,7 +71,7 @@ class ToolCopperFill(FlatCAMTool):
 
 
         self.grbobj_label = QtWidgets.QLabel("<b>%s:</b>" % _("GERBER"))
         self.grbobj_label = QtWidgets.QLabel("<b>%s:</b>" % _("GERBER"))
         self.grbobj_label.setToolTip(
         self.grbobj_label.setToolTip(
-            _("Gerber Object to which will be added a copper fill.")
+            _("Gerber Object to which will be added a copper thieving.")
         )
         )
 
 
         i_grid_lay.addWidget(self.grbobj_label, 0, 0)
         i_grid_lay.addWidget(self.grbobj_label, 0, 0)
@@ -93,7 +93,7 @@ class ToolCopperFill(FlatCAMTool):
         # CLEARANCE #
         # CLEARANCE #
         self.clearance_label = QtWidgets.QLabel('%s:' % _("Clearance"))
         self.clearance_label = QtWidgets.QLabel('%s:' % _("Clearance"))
         self.clearance_label.setToolTip(
         self.clearance_label.setToolTip(
-            _("This set the distance between the copper fill components\n"
+            _("This set the distance between the copper thieving components\n"
               "(the polygon fill may be split in multiple polygons)\n"
               "(the polygon fill may be split in multiple polygons)\n"
               "and the copper traces in the Gerber file.")
               "and the copper traces in the Gerber file.")
         )
         )
@@ -126,16 +126,16 @@ class ToolCopperFill(FlatCAMTool):
         ], orientation='vertical', stretch=False)
         ], orientation='vertical', stretch=False)
         self.reference_label = QtWidgets.QLabel(_("Reference:"))
         self.reference_label = QtWidgets.QLabel(_("Reference:"))
         self.reference_label.setToolTip(
         self.reference_label.setToolTip(
-            _("- 'Itself' - the copper fill extent is based on the object that is copper cleared.\n "
+            _("- 'Itself' - the copper thieving extent is based on the object that is copper cleared.\n "
               "- 'Area Selection' - left mouse click to start selection of the area to be filled.\n"
               "- 'Area Selection' - left mouse click to start selection of the area to be filled.\n"
-              "- 'Reference Object' - will do copper filling within the area specified by another object.")
+              "- 'Reference Object' - will do copper thieving within the area specified by another object.")
         )
         )
         grid_lay.addWidget(self.reference_label, 3, 0)
         grid_lay.addWidget(self.reference_label, 3, 0)
         grid_lay.addWidget(self.reference_radio, 3, 1)
         grid_lay.addWidget(self.reference_radio, 3, 1)
 
 
         self.box_combo_type_label = QtWidgets.QLabel('%s:' % _("Ref. Type"))
         self.box_combo_type_label = QtWidgets.QLabel('%s:' % _("Ref. Type"))
         self.box_combo_type_label.setToolTip(
         self.box_combo_type_label.setToolTip(
-            _("The type of FlatCAM object to be used as copper filling reference.\n"
+            _("The type of FlatCAM object to be used as copper thieving reference.\n"
               "It can be Gerber, Excellon or Geometry.")
               "It can be Gerber, Excellon or Geometry.")
         )
         )
         self.box_combo_type = QtWidgets.QComboBox()
         self.box_combo_type = QtWidgets.QComboBox()
@@ -178,8 +178,30 @@ class ToolCopperFill(FlatCAMTool):
         self.bbox_type_label.hide()
         self.bbox_type_label.hide()
         self.bbox_type_radio.hide()
         self.bbox_type_radio.hide()
 
 
-        # ## Insert Copper Fill
-        self.fill_button = QtWidgets.QPushButton(_("Insert Copper Fill"))
+        separator_line = QtWidgets.QFrame()
+        separator_line.setFrameShape(QtWidgets.QFrame.HLine)
+        separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
+        grid_lay.addWidget(separator_line, 7, 0, 1, 2)
+
+        # Fill Type
+        self.fill_type_radio = RadioSet([
+            {'label': _('Solid'), 'value': 'solid'},
+            {"label": _("Dots Grid"), "value": "dot"},
+            {"label": _("Squares Grid"), "value": "square"},
+            {"label": _("Lines Grid"), "value": "line"}
+        ], orientation='vertical', stretch=False)
+        self.fill_type_label = QtWidgets.QLabel(_("Fill Type:"))
+        self.fill_type_label.setToolTip(
+            _("- 'Solid' - copper thieving will be a solid polygon.\n "
+              "- 'Dots Grid' - the empty area will be filled with a pattern of dots.\n"
+              "- 'Squares Grid' - the empty area will be filled with a pattern of squares.\n"
+              "- 'Lines Grid' - the empty area will be filled with a pattern of lines.")
+        )
+        grid_lay.addWidget(self.fill_type_label, 8, 0)
+        grid_lay.addWidget(self.fill_type_radio, 8, 1)
+
+        # ## Insert Copper Thieving
+        self.fill_button = QtWidgets.QPushButton(_("Insert Copper thieving"))
         self.fill_button.setToolTip(
         self.fill_button.setToolTip(
             _("Will add a polygon (may be split in multiple parts)\n"
             _("Will add a polygon (may be split in multiple parts)\n"
               "that will surround the actual Gerber traces at a certain distance.")
               "that will surround the actual Gerber traces at a certain distance.")
@@ -188,7 +210,7 @@ class ToolCopperFill(FlatCAMTool):
 
 
         self.layout.addStretch()
         self.layout.addStretch()
 
 
-        # Objects involved in Copper filling
+        # Objects involved in Copper thieving
         self.grb_object = None
         self.grb_object = None
         self.ref_obj = None
         self.ref_obj = None
         self.sel_rect = list()
         self.sel_rect = list()
@@ -215,7 +237,7 @@ class ToolCopperFill(FlatCAMTool):
         self.reference_radio.group_toggle_fn = self.on_toggle_reference
         self.reference_radio.group_toggle_fn = self.on_toggle_reference
 
 
     def run(self, toggle=True):
     def run(self, toggle=True):
-        self.app.report_usage("ToolCopperFill()")
+        self.app.report_usage("ToolCopperThieving()")
 
 
         if toggle:
         if toggle:
             # if the splitter is hidden, display it, else hide it but only if the current widget is the same
             # if the splitter is hidden, display it, else hide it but only if the current widget is the same
@@ -240,19 +262,19 @@ class ToolCopperFill(FlatCAMTool):
 
 
         self.set_tool_ui()
         self.set_tool_ui()
 
 
-        self.app.ui.notebook.setTabText(2, _("Copper Fill Tool"))
+        self.app.ui.notebook.setTabText(2, _("Copper Thieving Tool"))
 
 
     def install(self, icon=None, separator=None, **kwargs):
     def install(self, icon=None, separator=None, **kwargs):
         FlatCAMTool.install(self, icon, separator, shortcut='ALT+F', **kwargs)
         FlatCAMTool.install(self, icon, separator, shortcut='ALT+F', **kwargs)
 
 
     def set_tool_ui(self):
     def set_tool_ui(self):
         self.units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value()
         self.units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value()
-        self.clearance_entry.set_value(float(self.app.defaults["tools_copperfill_clearance"]))
-        self.margin_entry.set_value(float(self.app.defaults["tools_copperfill_margin"]))
-        self.reference_radio.set_value(self.app.defaults["tools_copperfill_reference"])
-        self.bbox_type_radio.set_value(self.app.defaults["tools_copperfill_box_type"])
-
-        self.geo_steps_per_circle = int(self.app.defaults["tools_copperfill_circle_steps"])
+        self.clearance_entry.set_value(float(self.app.defaults["tools_copper_thieving_clearance"]))
+        self.margin_entry.set_value(float(self.app.defaults["tools_copper_thieving_margin"]))
+        self.reference_radio.set_value(self.app.defaults["tools_copper_thieving_reference"])
+        self.bbox_type_radio.set_value(self.app.defaults["tools_copper_thieving_box_type"])
+        self.fill_type_radio.set_value(self.app.defaults["tools_copper_thieving_fill_type"])
+        self.geo_steps_per_circle = int(self.app.defaults["tools_copper_thieving_circle_steps"])
 
 
         self.area_method = False
         self.area_method = False
 
 
@@ -281,20 +303,20 @@ class ToolCopperFill(FlatCAMTool):
             self.bbox_type_radio.hide()
             self.bbox_type_radio.hide()
 
 
     def execute(self):
     def execute(self):
-        self.app.call_source = "copperfill_tool"
+        self.app.call_source = "copper_thieving_tool"
 
 
         self.clearance_val = self.clearance_entry.get_value()
         self.clearance_val = self.clearance_entry.get_value()
         self.margin_val = self.margin_entry.get_value()
         self.margin_val = self.margin_entry.get_value()
         reference_method = self.reference_radio.get_value()
         reference_method = self.reference_radio.get_value()
 
 
-        # get the Gerber object on which the Copper fill will be inserted
+        # get the Gerber object on which the Copper thieving will be inserted
         selection_index = self.grb_object_combo.currentIndex()
         selection_index = self.grb_object_combo.currentIndex()
         model_index = self.app.collection.index(selection_index, 0, self.grb_object_combo.rootModelIndex())
         model_index = self.app.collection.index(selection_index, 0, self.grb_object_combo.rootModelIndex())
 
 
         try:
         try:
             self.grb_object = model_index.internalPointer().obj
             self.grb_object = model_index.internalPointer().obj
         except Exception as e:
         except Exception as e:
-            log.debug("ToolCopperFill.execute() --> %s" % str(e))
+            log.debug("ToolCopperThieving.execute() --> %s" % str(e))
             self.app.inform.emit('[WARNING_NOTCL] %s' % _("There is no Gerber object loaded ..."))
             self.app.inform.emit('[WARNING_NOTCL] %s' % _("There is no Gerber object loaded ..."))
             return 'fail'
             return 'fail'
 
 
@@ -487,17 +509,17 @@ class ToolCopperFill(FlatCAMTool):
         """
         """
 
 
         if run_threaded:
         if run_threaded:
-            proc = self.app.proc_container.new('%s ...' % _("Copper filling"))
+            proc = self.app.proc_container.new('%s ...' % _("Copper thieving"))
         else:
         else:
-            self.app.proc_container.view.set_busy('%s ...' % _("Copper filling"))
+            self.app.proc_container.view.set_busy('%s ...' % _("Copper thieving"))
             QtWidgets.QApplication.processEvents()
             QtWidgets.QApplication.processEvents()
 
 
         # #####################################################################
         # #####################################################################
         # ####### Read the parameters #########################################
         # ####### Read the parameters #########################################
         # #####################################################################
         # #####################################################################
 
 
-        log.debug("Copper Filling Tool started. Reading parameters.")
-        self.app.inform.emit(_("Copper Filling Tool started. Reading parameters."))
+        log.debug("Copper Thieving Tool started. Reading parameters.")
+        self.app.inform.emit(_("Copper Thieving Tool started. Reading parameters."))
 
 
         ref_selected = self.reference_radio.get_value()
         ref_selected = self.reference_radio.get_value()
         if c_val is None:
         if c_val is None:
@@ -512,8 +534,8 @@ class ToolCopperFill(FlatCAMTool):
         # #########################################################################################
         # #########################################################################################
         # Prepare isolation polygon. This will create the clearance over the Gerber features ######
         # Prepare isolation polygon. This will create the clearance over the Gerber features ######
         # #########################################################################################
         # #########################################################################################
-        log.debug("Copper Filling Tool. Preparing isolation polygons.")
-        self.app.inform.emit(_("Copper Filling Tool. Preparing isolation polygons."))
+        log.debug("Copper Thieving Tool. Preparing isolation polygons.")
+        self.app.inform.emit(_("Copper Thieving Tool. Preparing isolation polygons."))
 
 
         # variables to display the percentage of work done
         # variables to display the percentage of work done
         geo_len = 0
         geo_len = 0
@@ -557,8 +579,8 @@ class ToolCopperFill(FlatCAMTool):
         # #########################################################################################
         # #########################################################################################
         # Prepare the area to fill with copper. ###################################################
         # Prepare the area to fill with copper. ###################################################
         # #########################################################################################
         # #########################################################################################
-        log.debug("Copper Filling Tool. Preparing areas to fill with copper.")
-        self.app.inform.emit(_("Copper Filling Tool. Preparing areas to fill with copper."))
+        log.debug("Copper Thieving Tool. Preparing areas to fill with copper.")
+        self.app.inform.emit(_("Copper Thieving Tool. Preparing areas to fill with copper."))
 
 
         try:
         try:
             if ref_obj is None or ref_obj == 'itself':
             if ref_obj is None or ref_obj == 'itself':
@@ -566,7 +588,7 @@ class ToolCopperFill(FlatCAMTool):
             else:
             else:
                 working_obj = ref_obj
                 working_obj = ref_obj
         except Exception as e:
         except Exception as e:
-            log.debug("ToolCopperFIll.on_copper_fill() --> %s" % str(e))
+            log.debug("ToolCopperThieving.on_copper_fill() --> %s" % str(e))
             return 'fail'
             return 'fail'
 
 
         bounding_box = None
         bounding_box = None
@@ -647,9 +669,9 @@ class ToolCopperFill(FlatCAMTool):
                 self.app.inform.emit('[ERROR_NOTCL] %s' % _("The reference object type is not supported."))
                 self.app.inform.emit('[ERROR_NOTCL] %s' % _("The reference object type is not supported."))
                 return 'fail'
                 return 'fail'
 
 
-        log.debug("Copper Filling Tool. Finished creating areas to fill with copper.")
+        log.debug("Copper Thieving Tool. Finished creating areas to fill with copper.")
 
 
-        self.app.inform.emit(_("Copper Filling Tool. Appending new geometry and buffering."))
+        self.app.inform.emit(_("Copper Thieving Tool. Appending new geometry and buffering."))
         new_solid_geometry = bounding_box.difference(clearance_geometry)
         new_solid_geometry = bounding_box.difference(clearance_geometry)
 
 
         geo_list = self.grb_object.solid_geometry
         geo_list = self.grb_object.solid_geometry
@@ -689,7 +711,7 @@ class ToolCopperFill(FlatCAMTool):
                                                              local_use=self.grb_object, use_thread=False)
                                                              local_use=self.grb_object, use_thread=False)
 
 
         self.on_exit()
         self.on_exit()
-        self.app.inform.emit('[success] %s' % _("Copper Fill Tool done."))
+        self.app.inform.emit('[success] %s' % _("Copper Thieving Tool done."))
 
 
     def replot(self, obj):
     def replot(self, obj):
         def worker_task():
         def worker_task():
@@ -710,7 +732,7 @@ class ToolCopperFill(FlatCAMTool):
             self.grb_object.options['xmax'] = c
             self.grb_object.options['xmax'] = c
             self.grb_object.options['ymax'] = d
             self.grb_object.options['ymax'] = d
         except Exception as e:
         except Exception as e:
-            log.debug("ToolCopperFill.on_exit() bounds error --> %s" % str(e))
+            log.debug("ToolCopperThieving.on_exit() bounds error --> %s" % str(e))
 
 
         # reset the variables
         # reset the variables
         self.grb_object = None
         self.grb_object = None
@@ -746,4 +768,4 @@ class ToolCopperFill(FlatCAMTool):
                                                                   self.app.on_mouse_click_release_over_plot)
                                                                   self.app.on_mouse_click_release_over_plot)
 
 
         self.app.call_source = "app"
         self.app.call_source = "app"
-        self.app.inform.emit('[success] %s' % _("Copper Fill Tool exit."))
+        self.app.inform.emit('[success] %s' % _("Copper Thieving Tool exit."))

+ 8 - 8
flatcamTools/ToolQRCode.py

@@ -112,10 +112,10 @@ class QRCode(FlatCAMTool):
         self.error_label = QtWidgets.QLabel('%s:' % _("Error correction"))
         self.error_label = QtWidgets.QLabel('%s:' % _("Error correction"))
         self.error_label.setToolTip(
         self.error_label.setToolTip(
             _("Parameter that controls the error correction used for the QR Code.\n"
             _("Parameter that controls the error correction used for the QR Code.\n"
-              "L = maximum 7% errors can be corrected\n"
-              "M = maximum 15% errors can be corrected\n"
-              "Q = maximum 25% errors can be corrected\n"
-              "H = maximum 30% errors can be corrected.")
+              "L = maximum 7%% errors can be corrected\n"
+              "M = maximum 15%% errors can be corrected\n"
+              "Q = maximum 25%% errors can be corrected\n"
+              "H = maximum 30%% errors can be corrected.")
         )
         )
         self.error_radio = RadioSet([{'label': 'L', 'value': 'L'},
         self.error_radio = RadioSet([{'label': 'L', 'value': 'L'},
                                      {'label': 'M', 'value': 'M'},
                                      {'label': 'M', 'value': 'M'},
@@ -123,10 +123,10 @@ class QRCode(FlatCAMTool):
                                      {'label': 'H', 'value': 'H'}])
                                      {'label': 'H', 'value': 'H'}])
         self.error_radio.setToolTip(
         self.error_radio.setToolTip(
             _("Parameter that controls the error correction used for the QR Code.\n"
             _("Parameter that controls the error correction used for the QR Code.\n"
-              "L = maximum 7% errors can be corrected\n"
-              "M = maximum 15% errors can be corrected\n"
-              "Q = maximum 25% errors can be corrected\n"
-              "H = maximum 30% errors can be corrected.")
+              "L = maximum 7%% errors can be corrected\n"
+              "M = maximum 15%% errors can be corrected\n"
+              "Q = maximum 25%% errors can be corrected\n"
+              "H = maximum 30%% errors can be corrected.")
         )
         )
         grid_lay.addWidget(self.error_label, 2, 0)
         grid_lay.addWidget(self.error_label, 2, 0)
         grid_lay.addWidget(self.error_radio, 2, 1)
         grid_lay.addWidget(self.error_radio, 2, 1)

+ 2 - 2
flatcamTools/ToolSolderPaste.py

@@ -557,7 +557,7 @@ class SolderPaste(FlatCAMTool):
 
 
         try:
         try:
             dias = [float(eval(dia)) for dia in self.app.defaults["tools_solderpaste_tools"].split(",") if dia != '']
             dias = [float(eval(dia)) for dia in self.app.defaults["tools_solderpaste_tools"].split(",") if dia != '']
-        except:
+        except Exception:
             log.error("At least one Nozzle tool diameter needed. "
             log.error("At least one Nozzle tool diameter needed. "
                       "Verify in Edit -> Preferences -> TOOLS -> Solder Paste Tools.")
                       "Verify in Edit -> Preferences -> TOOLS -> Solder Paste Tools.")
             return
             return
@@ -675,7 +675,7 @@ class SolderPaste(FlatCAMTool):
         if row is None:
         if row is None:
             try:
             try:
                 current_row = self.tools_table.currentRow()
                 current_row = self.tools_table.currentRow()
-            except:
+            except Exception:
                 current_row = 0
                 current_row = 0
         else:
         else:
             current_row = row
             current_row = row

+ 1 - 1
flatcamTools/__init__.py

@@ -29,7 +29,7 @@ from flatcamTools.ToolProperties import Properties
 from flatcamTools.ToolQRCode import QRCode
 from flatcamTools.ToolQRCode import QRCode
 from flatcamTools.ToolRulesCheck import RulesCheck
 from flatcamTools.ToolRulesCheck import RulesCheck
 
 
-from flatcamTools.ToolCopperFill import ToolCopperFill
+from flatcamTools.ToolCopperThieving import ToolCopperThieving
 
 
 from flatcamTools.ToolShell import FCShell
 from flatcamTools.ToolShell import FCShell
 from flatcamTools.ToolSolderPaste import SolderPaste
 from flatcamTools.ToolSolderPaste import SolderPaste

BIN
locale/ro/LC_MESSAGES/strings.mo


Разница между файлами не показана из-за своего большого размера
+ 243 - 216
locale/ro/LC_MESSAGES/strings.po


Разница между файлами не показана из-за своего большого размера
+ 357 - 311
locale_template/strings.pot


+ 1 - 1
tclCommands/TclCommandAddCircle.py

@@ -56,7 +56,7 @@ class TclCommandAddCircle(TclCommand):
 
 
         try:
         try:
             obj = self.app.collection.get_by_name(str(obj_name))
             obj = self.app.collection.get_by_name(str(obj_name))
-        except Exception as e:
+        except Exception:
             return "Could not retrieve object: %s" % obj_name
             return "Could not retrieve object: %s" % obj_name
         if obj is None:
         if obj is None:
             return "Object not found: %s" % obj_name
             return "Object not found: %s" % obj_name

+ 1 - 1
tclCommands/TclCommandAddRectangle.py

@@ -58,7 +58,7 @@ class TclCommandAddRectangle(TclCommandSignaled):
 
 
         try:
         try:
             obj = self.app.collection.get_by_name(str(obj_name))
             obj = self.app.collection.get_by_name(str(obj_name))
-        except Exception as e:
+        except Exception:
             return "Could not retrieve object: %s" % obj_name
             return "Could not retrieve object: %s" % obj_name
         if obj is None:
         if obj is None:
             return "Object not found: %s" % obj_name
             return "Object not found: %s" % obj_name

+ 2 - 2
tclCommands/TclCommandAlignDrill.py

@@ -81,7 +81,7 @@ class TclCommandAlignDrill(TclCommandSignaled):
         # Get source object.
         # Get source object.
         try:
         try:
             obj = self.app.collection.get_by_name(str(name))
             obj = self.app.collection.get_by_name(str(name))
-        except:
+        except Exception:
             return "Could not retrieve object: %s" % name
             return "Could not retrieve object: %s" % name
 
 
         if obj is None:
         if obj is None:
@@ -179,7 +179,7 @@ class TclCommandAlignDrill(TclCommandSignaled):
         if 'box' in args:
         if 'box' in args:
             try:
             try:
                 box = self.app.collection.get_by_name(args['box'])
                 box = self.app.collection.get_by_name(args['box'])
-            except:
+            except Exception:
                 return "Could not retrieve object box: %s" % args['box']
                 return "Could not retrieve object box: %s" % args['box']
 
 
             if box is None:
             if box is None:

+ 1 - 1
tclCommands/TclCommandGeoUnion.py

@@ -52,7 +52,7 @@ class TclCommandGeoUnion(TclCommand):
 
 
         try:
         try:
             obj = self.app.collection.get_by_name(str(obj_name))
             obj = self.app.collection.get_by_name(str(obj_name))
-        except:
+        except Exception:
             return "Could not retrieve object: %s" % obj_name
             return "Could not retrieve object: %s" % obj_name
         if obj is None:
         if obj is None:
             return "Object not found: %s" % obj_name
             return "Object not found: %s" % obj_name

+ 1 - 1
tclCommands/TclCommandMillSlots.py

@@ -75,7 +75,7 @@ class TclCommandMillSlots(TclCommandSignaled):
 
 
         try:
         try:
             obj = self.app.collection.get_by_name(str(name))
             obj = self.app.collection.get_by_name(str(name))
-        except:
+        except Exception:
             obj = None
             obj = None
             self.raise_tcl_error("Could not retrieve object: %s" % name)
             self.raise_tcl_error("Could not retrieve object: %s" % name)
 
 

+ 2 - 2
tclCommands/TclCommandMirror.py

@@ -57,7 +57,7 @@ class TclCommandMirror(TclCommandSignaled):
         # Get source object.
         # Get source object.
         try:
         try:
             obj = self.app.collection.get_by_name(str(name))
             obj = self.app.collection.get_by_name(str(name))
-        except Exception as e:
+        except Exception:
             return "Could not retrieve object: %s" % name
             return "Could not retrieve object: %s" % name
 
 
         if obj is None:
         if obj is None:
@@ -78,7 +78,7 @@ class TclCommandMirror(TclCommandSignaled):
         if 'box' in args:
         if 'box' in args:
             try:
             try:
                 box = self.app.collection.get_by_name(args['box'])
                 box = self.app.collection.get_by_name(args['box'])
-            except Exception as e:
+            except Exception:
                 return "Could not retrieve object box: %s" % args['box']
                 return "Could not retrieve object box: %s" % args['box']
 
 
             if box is None:
             if box is None:

+ 1 - 1
tclCommands/TclCommandPanelize.py

@@ -80,7 +80,7 @@ class TclCommandPanelize(TclCommand):
             boxname = args['box']
             boxname = args['box']
             try:
             try:
                 box = self.app.collection.get_by_name(boxname)
                 box = self.app.collection.get_by_name(boxname)
-            except Exception as e:
+            except Exception:
                 return "Could not retrieve object: %s" % name
                 return "Could not retrieve object: %s" % name
         else:
         else:
             box = obj
             box = obj

+ 1 - 1
tclCommands/TclCommandSubtractPoly.py

@@ -57,7 +57,7 @@ class TclCommandSubtractPoly(TclCommandSignaled):
 
 
         try:
         try:
             obj = self.app.collection.get_by_name(str(obj_name))
             obj = self.app.collection.get_by_name(str(obj_name))
-        except Exception as e:
+        except Exception:
             return "Could not retrieve object: %s" % obj_name
             return "Could not retrieve object: %s" % obj_name
         if obj is None:
         if obj is None:
             return "Object not found: %s" % obj_name
             return "Object not found: %s" % obj_name

+ 2 - 1
tclCommands/TclCommandSubtractRectangle.py

@@ -70,8 +70,9 @@ class TclCommandSubtractRectangle(TclCommandSignaled):
 
 
         try:
         try:
             obj = self.app.collection.get_by_name(str(obj_name))
             obj = self.app.collection.get_by_name(str(obj_name))
-        except Exception as e:
+        except Exception:
             return "Could not retrieve object: %s" % obj_name
             return "Could not retrieve object: %s" % obj_name
+
         if obj is None:
         if obj is None:
             return "Object not found: %s" % obj_name
             return "Object not found: %s" % obj_name
 
 

+ 1 - 1
tclCommands/TclCommandWriteGCode.py

@@ -90,7 +90,7 @@ class TclCommandWriteGCode(TclCommandSignaled):
 
 
         try:
         try:
             obj = self.app.collection.get_by_name(str(obj_name))
             obj = self.app.collection.get_by_name(str(obj_name))
-        except Exception as e:
+        except Exception:
             if muted == 0:
             if muted == 0:
                 return "Could not retrieve object: %s" % obj_name
                 return "Could not retrieve object: %s" % obj_name
             else:
             else:

Некоторые файлы не были показаны из-за большого количества измененных файлов