Fixed refactor issues breaking unit tests

This commit is contained in:
Markus Lampert
2022-08-13 21:40:42 -07:00
parent 5ca5a94f5e
commit 080d708f21
7 changed files with 14 additions and 10 deletions

View File

@@ -24,10 +24,10 @@ from PySide import QtCore, QtGui
import FreeCAD
import FreeCADGui
import Path
import Path.Base.Gui.IconViewProvider as PathIconViewProvider
import Path.Base.Gui.PropertyEditor as PathPropertyEditor
import Path.Base.PropertyBag as PathPropertyBag
import Path.Base.Util as PathUtil
import PathScripts.PathIconViewProvider as PathIconViewProvider
import PathScripts.PathPropertyEditor as PathPropertyEditor
import re

View File

@@ -24,7 +24,7 @@ import FreeCAD
import FreeCADGui
import Path
import Path.Base.Gui.IconViewProvider as PathIconViewProvider
import Path.Base.Gui.SetupSheetOpPrototypeGui as PathSetupSheetOpPrototypeGui
import Path.Base.Gui.SetupSheetOpPrototype as PathSetupSheetOpPrototypeGui
import Path.Base.Gui.Util as PathGuiUtil
import Path.Base.SetupSheet as PathSetupSheet
import Path.Base.Util as PathUtil

View File

@@ -39,7 +39,7 @@ def Startup():
if not Processed:
Path.Log.debug("Initializing PathGui")
from Path.Base.Gui import PropertyBag
from Path.Base.Gui import PathSetupSheetGui
from Path.Base.Gui import SetupSheet
from Path.Dressup.Gui import AxisMap
from Path.Dressup.Gui import Dogbone
from Path.Dressup.Gui import Dragknife

View File

@@ -23,8 +23,8 @@
from PySide import QtCore, QtGui
import FreeCADGui
import Path
import Path.Base.Gui.PropertyEditor as PathPropertyEditor
import Path.Base.Gui.Util as PathGuiUtil
import Path.Base.PropertyEditor as PathPropertyEditor
import Path.Base.Util as PathUtil
import os
import re

View File

@@ -31,7 +31,6 @@ import Path.Tool.Controller as PathToolController
import PathScripts.PathStock as PathStock
import json
import time
import Path
# lazily loaded modules

View File

@@ -28,7 +28,7 @@ from pivy import coin
import FreeCAD
import FreeCADGui
import Path
import Path.Base.Gui.SetupSheetGui as PathSetupSheetGui
import Path.Base.Gui.SetupSheet as PathSetupSheetGui
import Path.Base.Util as PathUtil
import Path.GuiInit as PathGuiInit
import Path.Tool.Gui.Bit as PathToolBitGui

View File

@@ -325,7 +325,6 @@ class StockCreateCylinder(Stock):
if prop in ["Radius", "Height"] and not "Restore" in obj.State:
self.execute(obj)
def SetupStockObject(obj, stockType):
Path.Log.track(obj.Label, stockType)
if FreeCAD.GuiUp and obj.ViewObject:
@@ -338,9 +337,15 @@ def SetupStockObject(obj, stockType):
obj.StockType = stockType
obj.setEditorMode("StockType", 2) # hide
import Path.Base.Gui.IconViewProvider
# If I don't rename the module then usage as Path.Base.Gui.IconViewProvider below
# 'causes above Path.Log.track(...) to fail with - claiming that Path is accessed
# before it's assigned.
# Alternative _another_ `import Path` statement in front of `Path.Log.track(...)`
# also prevents the issue from happening.
# Go figure.
import Path.Base.Gui.IconViewProvider as PathIconViewProvider
Path.Base.Gui.IconViewProvider.ViewProvider(obj.ViewObject, "Stock")
PathIconViewProvider.ViewProvider(obj.ViewObject, "Stock")
obj.ViewObject.Transparency = 90
obj.ViewObject.DisplayMode = "Wireframe"