How to use the ttp.ttp._group_class function in ttp

To help you get started, we’ve selected a few ttp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dmulyalin / ttp / ttp / ttp.py View on Github external
def get_children(self, child_groups):
        """Method to create child groups objects
        by iterating over all children.
        """
        for g in child_groups:
            self.children.append(
                _group_class(
                    element=g,
                    top=False,
                    path=self.path,
                    pathchar=self.pathchar,
                    vars=self.vars,
                )
            )
            # get regexes from tail
            if g.tail.strip():
                self.get_regexes(data=g.tail, tail=True)
github dmulyalin / ttp / ttp / ttp.py View on Github external
def parse_group(element, grp_index):
            self.groups.append(
                _group_class(
                    element,
                    top=True,
                    pathchar=self.PATHCHAR,
                    vars=self.vars,
                    grp_index=grp_index,
                )