Example #1
0
    def from_pipe(cls, config):
        """Create Reader and read tree from incomming pipe."""
        temp = cls(config)
        try:
            temp.tree = GrepTree.load(sys.stdin)
        except ValueError:
            if temp.debug:
                warn("Choked on input from pipe")
            temp.tree = GrepTree()

        return temp
Example #2
0
    def from_file(cls, config, path):
        """Create Reader and populate tree from file."""
        temp = cls(config)
        temp.tree = GrepTree.load_path(path)

        return temp