示例#1
0
    def process(self, code):
        callerName = inspect.stack()[1][3][5:]

        permutation = Permutation.Permutation({"jasy.engine": "gecko", "jasy.debug": True})

        tree = Engine.getTree(code, callerName)
        tree = Engine.permutateTree(tree, permutation)
        tree = Engine.reduceTree(tree)

        return Engine.compressTree(tree)
示例#2
0
    def process(self, code):
        callerName = inspect.stack()[1][3][5:]

        permutation = Permutation.Permutation({
            "jasy.engine": "gecko",
            "jasy.debug": True
        })

        tree = Engine.getTree(code, callerName)
        tree = Engine.permutateTree(tree, permutation)
        tree = Engine.reduceTree(tree)

        return Engine.compressTree(tree)
示例#3
0
文件: Style.py 项目: isabella232/jasy
    def __getPermutatedTree(self, permutation=None):
        """
        Returns a permutated tree: a copy of the original tree
        where conditions based on the given permutation are resolved.
        """

        if permutation is None:
            return self.__getTree()

        permutation = self.filterPermutation(permutation)
        field = "style:permutated[%s]-%s" % (self.id, permutation)
        tree = self.project.getCache().read(field, self.mtime)

        if not tree:
            tree = copy.deepcopy(self.__getTree())

            Console.info("Permutating stylesheet %s...", Console.colorize(self.id, "bold"))
            Console.indent()
            Engine.permutateTree(tree, permutation)
            Console.outdent()

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

        return tree