cleanup and add get_api method
This commit is contained in:
parent
da64ab6b6e
commit
cfdbdd32bb
1 changed files with 11 additions and 6 deletions
|
@ -2,7 +2,6 @@ class BaseObject:
|
||||||
TYPE = None
|
TYPE = None
|
||||||
|
|
||||||
def __init__(self, feature):
|
def __init__(self, feature):
|
||||||
print(self.__class__)
|
|
||||||
self.feature = feature
|
self.feature = feature
|
||||||
|
|
||||||
feature.Proxy = self
|
feature.Proxy = self
|
||||||
|
@ -13,12 +12,18 @@ class BaseObject:
|
||||||
feature.Type = self.TYPE
|
feature.Type = self.TYPE
|
||||||
|
|
||||||
def execute(self, feature):
|
def execute(self, feature):
|
||||||
pass
|
# TODO this might not be the right move
|
||||||
|
self.onDocumentRestored(feature)
|
||||||
|
|
||||||
def setup_extensions(self):
|
def get_api(self):
|
||||||
if hasattr(self.parent.__class__, 'EXTENSIONS'):
|
p = self.feature
|
||||||
for ext in self.parent.__class__.EXTENSIONS:
|
|
||||||
self.feature.addExtension(ext)
|
while p:
|
||||||
|
if p.Type == 'KiConnect::Project':
|
||||||
|
return [ o for o in p.Group if hasattr(o, 'Type') and o.Type == 'KiConnect::API' ][0].Proxy
|
||||||
|
p = p.getParent()
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
def onBeforeChange(self, feature, prop):
|
def onBeforeChange(self, feature, prop):
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Add table
Reference in a new issue