def add_nodes(tr, dr, solution): (t, chs) = solution img_path = tr.put_some(simplex_table_to_tex_table_only(t)) dr.add_node_lonely(0, img_path) i = 1 for ch in chs: i = add_node(tr, dr, i, 0, ch)
def add_node(tr, dr, i, pid, table): (t, chs) = table table_img_path = tr.put_some(simplex_table_to_tex_table_only(t)) assumps = simplex_table_to_tex_assumptions(t) c_img_path = tr.put_some(assumps) np = list() """c, pp = simplex_table_to_tex_assumptions(t) c_img_path = '' if len(c) > 0: c_img_path = tr.put_some(c) np = list() for p in pp: p_img_path = '' if len(p) > 0: p_img_path = tr.put_some(p) np.append(p_img_path)""" if not t.solution: dr.add_node(i, pid, table_img_path, c_img_path, np) else: solution_img_path = tr.put_some(simplex_table_to_tex_solution_good(t)) dr.add_node_solution(i, pid, table_img_path, solution_img_path, c_img_path, np) _i = i + 1 for ch in chs: _i = add_node(tr, dr, _i, i, ch) return _i