def _parse_nested_tags(self, lineno, line): tags = line.split(self.NESTED_TAGS_SEP) nodes = [] node_lines = [] #Used to make a nicer error message for line in [x.strip() for x in tags]: node = self._parse_node(lineno, line) if nodes and not nodes[-1].can_have_children(): raise TemplateSyntaxError('Node "%s" can\'t contain children' % node_lines[-1], lineno) nodes.append(node) node_lines.append(line) return NestedTags(nodes)
def add_node(node): nodes.append(node)
def add_nodes(ip,port): node={"ip":ip,"port":port} if node not in nodes: nodes.append(node) return jsonify(nodes)