FEM: Python object base classes, some tweaks

This commit is contained in:
Bernd Hahnebach
2020-03-05 12:03:24 +01:00
parent 9d311b2b12
commit 062d782236
2 changed files with 8 additions and 3 deletions

View File

@@ -97,8 +97,7 @@ class ViewProxy(object):
FreeCAD.Console.PrintError(message + "\n")
return True
def __getstate__(self):
return None
# a few objects had this method in their class before the move to this base class
# these objects will give a setAttr failed error on document loading without this method
def __setstate__(self, state):
return None

View File

@@ -37,4 +37,10 @@ class Proxy(object):
self.Object = obj # keep a ref to the DocObj for nonGui usage
obj.Proxy = self # link between App::DocumentObject to this object
# a few objects had this method in their class before the move to this base class
# these objects will give a setAttr failed error on document loading without this method
def __setstate__(self, state):
if state:
self.Type = state
## @}