- replaced the testing if instance of FlatCAMObj with testing the obj.kind attribute

- removed the import of the whole FlatCAMApp file only for the usage of GracefulException
- remove the import of FlatCAMApp and used alternate ways
- optimized the imports in some files
- moved the Bookmarksmanager and ToolDB classes into their own files
- solved some bugs that were not so visible in the Editors and HPGL parser
This commit is contained in:
Marius Stanciu
2020-04-27 10:03:22 +03:00
committed by Marius
parent 61020e3624
commit 3ec666edbb
28 changed files with 3452 additions and 3389 deletions

View File

@@ -46,6 +46,10 @@ import socket
# #######################################
# # Imports part of FlatCAM ##
# #######################################
from FlatCAMCommon import LoudDict, color_variant
from FlatCAMBookmark import BookmarkManager
from FlatCAMDB import ToolsDB2
from ObjectCollection import *
from FlatCAMObj import *
from camlib import to_dict, dict2obj, ET, ParseError
@@ -55,7 +59,6 @@ from flatcamGUI.PlotCanvasLegacy import *
from flatcamGUI.FlatCAMGUI import *
from flatcamGUI.GUIElements import FCFileSaveDialog
from FlatCAMCommon import LoudDict, BookmarkManager, ToolsDB, ToolsDB2, color_variant
from FlatCAMPostProc import load_preprocessors
from flatcamEditors.FlatCAMGeoEditor import FlatCAMGeoEditor
@@ -4313,7 +4316,7 @@ class App(QtCore.QObject):
# update the KeyWords list with the name of the file
self.myKeywords.append(obj.options['name'])
FlatCAMApp.App.log.debug("Moving new object back to main thread.")
log.debug("Moving new object back to main thread.")
# Move the object to the main thread and let the app know that it is available.
obj.moveToThread(self.main_thread)
@@ -12862,13 +12865,4 @@ class ArgsThread(QtCore.QObject):
def run(self):
self.my_loop(self.address)
class GracefulException(Exception):
# Graceful Exception raised when the user is requesting to cancel the current threaded task
def __init__(self):
super().__init__()
def __str__(self):
return '\n\n%s' % _("The user requested a graceful exit of the current task.")
# end of file