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)
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)
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