remove parent api, change Type handling and some setup reordering
unsure if the extensions is even going to get used
This commit is contained in:
parent
e5ec81b2dd
commit
b02645a195
1 changed files with 15 additions and 12 deletions
|
@ -1,23 +1,18 @@
|
|||
class BaseObject:
|
||||
def __init__(self, parent, feature):
|
||||
print(self)
|
||||
self.parent = parent
|
||||
TYPE = None
|
||||
|
||||
def __init__(self, feature):
|
||||
print(self.__class__)
|
||||
self.feature = feature
|
||||
|
||||
feature.Proxy = self
|
||||
|
||||
self.Type = ''
|
||||
self.setup_properties(feature)
|
||||
self.setup_extensions(feature)
|
||||
|
||||
if hasattr(parent.__class__, 'TYPE'):
|
||||
self.Type = parent.__class__.TYPE
|
||||
|
||||
self.setup_properties()
|
||||
self.setup_extensions()
|
||||
feature.Type = self.TYPE
|
||||
|
||||
def execute(self, feature):
|
||||
print('execute', feature.Label, self.Type)
|
||||
|
||||
def setup_properties(self):
|
||||
pass
|
||||
|
||||
def setup_extensions(self):
|
||||
|
@ -31,5 +26,13 @@ class BaseObject:
|
|||
def onChanged(self, feature, prop):
|
||||
pass
|
||||
|
||||
def setup_extensions(self, feature):
|
||||
if hasattr(self, 'EXTENSIONS'):
|
||||
for ext in self.EXTENSIONS:
|
||||
self.feature.addExtension(ext)
|
||||
|
||||
def setup_properties(self, feature):
|
||||
feature.addProperty('App::PropertyString', 'Type', 'KiConnect', 'Internatl KiConnect Type', read_only=True, hidden=True)
|
||||
|
||||
def __getstate__(self):
|
||||
return None
|
||||
|
|
Loading…
Add table
Reference in a new issue