set enumeration default properties after .initOperation

This allows subclasses to override opPropertyEnumerations and have their defaults set by ObjectOp.__init__
This commit is contained in:
Morgan 'ARR\!' Allen
2023-04-02 13:05:35 -07:00
parent 881e131e17
commit 50d23dfe9a

View File

@@ -332,12 +332,6 @@ class ObjectOp(object):
),
)
for n in self.opPropertyEnumerations():
Path.Log.debug("n: {}".format(n))
Path.Log.debug("n[0]: {} n[1]: {}".format(n[0], n[1]))
if hasattr(obj, n[0]):
setattr(obj, n[0], n[1])
# members being set later
self.commandlist = None
self.horizFeed = None
@@ -353,6 +347,12 @@ class ObjectOp(object):
self.initOperation(obj)
for n in self.opPropertyEnumerations():
Path.Log.debug("n: {}".format(n))
Path.Log.debug("n[0]: {} n[1]: {}".format(n[0], n[1]))
if hasattr(obj, n[0]):
setattr(obj, n[0], n[1])
if not hasattr(obj, "DoNotSetDefaultValues") or not obj.DoNotSetDefaultValues:
if parentJob:
self.job = PathUtils.addToJob(obj, jobname=parentJob.Name)