Basic ToolBitLibrary edit dialog

This commit is contained in:
Markus Lampert
2019-10-27 02:00:18 -07:00
parent 5d6fc167e9
commit 97904d0bf2
5 changed files with 380 additions and 6 deletions

View File

@@ -261,10 +261,13 @@ class ToolBit(object):
PathLog.error("Could not save tool %s to %s (%s)" % (obj.Label, path, e))
raise
def Declaration(path):
with open(path, 'r') as fp:
return json.load(fp)
def CreateFrom(path, name = 'ToolBit'):
try:
with open(path, 'r') as fp:
data = json.load(fp)
data = Declaration(path)
obj = Create(name, data['template'])
obj.Label = data['name']
params = data['parameter']