make default mutable 'true' and data on branches
This commit is contained in:
@ -583,7 +583,7 @@ def init_context():
|
|||||||
ContextStack[ContextIndex]['driveable'] = None
|
ContextStack[ContextIndex]['driveable'] = None
|
||||||
ContextStack[ContextIndex]['control'] = 'true'
|
ContextStack[ContextIndex]['control'] = 'true'
|
||||||
ContextStack[ContextIndex]['data'] = 'true'
|
ContextStack[ContextIndex]['data'] = 'true'
|
||||||
ContextStack[ContextIndex]['mutable'] = 'false'
|
ContextStack[ContextIndex]['mutable'] = 'true'
|
||||||
ContextStack[ContextIndex]['nxsave'] = 'true'
|
ContextStack[ContextIndex]['nxsave'] = 'true'
|
||||||
ContextStack[ContextIndex]['read_function'] = 'rdValue'
|
ContextStack[ContextIndex]['read_function'] = 'rdValue'
|
||||||
ContextStack[ContextIndex]['write_function'] = 'setValue'
|
ContextStack[ContextIndex]['write_function'] = 'setValue'
|
||||||
@ -730,8 +730,40 @@ def build_group(MyDriver, p):
|
|||||||
if key in ContextStack[ContextIndex]:
|
if key in ContextStack[ContextIndex]:
|
||||||
ContextStack[ContextIndex][key] = item[key]
|
ContextStack[ContextIndex][key] = item[key]
|
||||||
pop_context()
|
pop_context()
|
||||||
|
adjust_group(MyGroup)
|
||||||
return MyGroup
|
return MyGroup
|
||||||
|
|
||||||
|
def adjust_group(MyGroup):
|
||||||
|
if Verbose:
|
||||||
|
print 'ante adjust_group', MyGroup
|
||||||
|
MyData = None
|
||||||
|
for var in MyGroup['Vars']:
|
||||||
|
if Verbose:
|
||||||
|
print "Var:", MyGroup['Vars'][var]
|
||||||
|
if 'data' in MyGroup['Vars'][var]:
|
||||||
|
if MyGroup['Vars'][var]['data'] == 'true':
|
||||||
|
MyData = 'true'
|
||||||
|
else:
|
||||||
|
MyData = 'false'
|
||||||
|
break
|
||||||
|
if MyData is None:
|
||||||
|
for grp in MyGroup['Groups']:
|
||||||
|
if Verbose:
|
||||||
|
print "Grp:", MyGroup['Groups'][grp]
|
||||||
|
adjust_group(MyGroup['Groups'][grp])
|
||||||
|
if 'data' in MyGroup['Groups'][grp]['GroupProperty']:
|
||||||
|
if MyGroup['Groups'][grp]['GroupProperty']['data'] == 'true':
|
||||||
|
MyData = 'true'
|
||||||
|
else:
|
||||||
|
MyData = 'false'
|
||||||
|
break
|
||||||
|
if MyData is not None:
|
||||||
|
if 'GroupProperty' not in MyGroup:
|
||||||
|
MyGroup['GroupProperty'] = {}
|
||||||
|
MyGroup['GroupProperty']['data'] = MyData
|
||||||
|
if Verbose:
|
||||||
|
print 'post adjust_group', MyGroup
|
||||||
|
|
||||||
def build_driver(MyDriver, TheTree):
|
def build_driver(MyDriver, TheTree):
|
||||||
if Verbose:
|
if Verbose:
|
||||||
print "TheTree:", TheTree
|
print "TheTree:", TheTree
|
||||||
@ -784,8 +816,11 @@ def dump_driver_groups(groups, indent):
|
|||||||
print indent + 'GROUP ' + item + ' = {'
|
print indent + 'GROUP ' + item + ' = {'
|
||||||
else:
|
else:
|
||||||
print indent + 'GROUP = {'
|
print indent + 'GROUP = {'
|
||||||
for subitem in sorted([x for x in groups[item] if not x in ['Groups', 'Vars']]):
|
for subitem in sorted([x for x in groups[item] if not x in ['Groups', 'Vars', 'GroupProperty']]):
|
||||||
print indent + ' ', subitem, '=', groups[item][subitem]
|
print indent + ' ', subitem, '=', groups[item][subitem]
|
||||||
|
if 'GroupProperty' in groups[item]:
|
||||||
|
for subitem in groups[item]['GroupProperty']:
|
||||||
|
print indent + ' GroupProperty', subitem, '=', groups[item]['GroupProperty'][subitem]
|
||||||
dump_driver_vars(groups[item]['Vars'], indent)
|
dump_driver_vars(groups[item]['Vars'], indent)
|
||||||
dump_driver_groups(groups[item]['Groups'], indent + ' ')
|
dump_driver_groups(groups[item]['Groups'], indent + ' ')
|
||||||
print indent + '}'
|
print indent + '}'
|
||||||
|
Reference in New Issue
Block a user