Beispiel #1
0
    def __getTree(self, context=None):
        """
        Returns the parsed tree
        """

        field = "tree[%s]" % self.id
        tree = self.project.getCache().read(field, self.mtime)
        if not tree:
            Console.info(
                "Processing stylesheet %s %s...",
                Console.colorize(self.id, "bold"),
                Console.colorize("[%s]" % context, "cyan"),
            )

            Console.indent()
            tree = Parser.parse(self.getText(), self.id)
            Console.outdent()

            self.project.getCache().store(field, tree, self.mtime, True)

        return tree
Beispiel #2
0
def getTree(text, fileId=None):
    """
    Returns a tree of nodes from the given text
    """

    return Parser.parse(text, fileId)
Beispiel #3
0
def getTree(text, fileId=None):
    """Returns a tree of nodes from the given text."""

    return Parser.parse(text, fileId)