def populate_group_command_tree(group, groups_map,cmds_map):
## Inrease the limit just in case recursive func calling use up recursionlimit
#import sys
#sys.setrecursionlimit(10000)
subgroups = []
for subgroup_name in group['subgroups']:
if groups_map.has_key(subgroup_name):
subgroup = groups_map[subgroup_name]
populate_group_command_tree(subgroup, groups_map, cmds_map)
subgroups.append(subgroup)
group['subgroups']=subgroups
cmd_list = []
for cmd_name in group['commands']:
if cmds_map.has_key(cmd_name):
cmd_list.append(cmds_map[cmd_name])
group['commands']=cmd_list
评论列表
文章目录