You can now add and remove work plans with a new UI. Thanks @bosonprojets and @jesusbill!

This commit is contained in:
Dion Moult
2021-03-31 11:35:40 +11:00
parent d2f19e7c28
commit 1631dc39f5
6 changed files with 125 additions and 0 deletions
@@ -0,0 +1,14 @@
class Usecase:
def __init__(self, file, **settings):
self.file = file
self.settings = {"work_plan": None}
for key, value in settings.items():
self.settings[key] = value
def execute(self):
# TODO: do a deep purge
if self.settings["work_plan"].HasContext:
rel_declares = self.settings["work_plan"].HasContext[0]
if len(rel_declares.RelatedDefinitions) == 1:
self.file.remove(rel_declares)
self.file.remove(self.settings["work_plan"])