예제 #1
0
    def __call__(self, t, **mapping):
        ttype = t in self.map and self.map[t][0] or 'default'
        if ttype not in self.ecache:
            self.ecache[ttype] = engines[ttype](self.load,
                                                 self.filters, self.defaults)
        proc = self.ecache[ttype]

        stream = proc.process(t, mapping)
        if self.minchunk:
            stream = util.increasingchunks(stream, min=self.minchunk,
                                           max=self.maxchunk)
        return stream
예제 #2
0
파일: templater.py 프로젝트: as/9front-work
    def __call__(self, t, **map):
        ttype = t in self.map and self.map[t][0] or 'default'
        proc = self.engines.get(ttype)
        if proc is None:
            proc = engines[ttype](self.load, self.filters, self.defaults)
            self.engines[ttype] = proc

        stream = proc.process(t, map)
        if self.minchunk:
            stream = util.increasingchunks(stream, min=self.minchunk,
                                           max=self.maxchunk)
        return stream
예제 #3
0
    def __call__(self, t, **mapping):
        ttype = t in self.map and self.map[t][0] or 'default'
        proc = self.engines.get(ttype)
        if proc is None:
            proc = engines[ttype](self.load, self.filters, self.defaults)
            self.engines[ttype] = proc

        stream = proc.process(t, mapping)
        if self.minchunk:
            stream = util.increasingchunks(stream, min=self.minchunk,
                                           max=self.maxchunk)
        return stream
예제 #4
0
    def __call__(self, t, **mapping):
        ttype = t in self.map and self.map[t][0] or 'default'
        if ttype not in self.ecache:
            self.ecache[ttype] = engines[ttype](self.load,
                                                 self.filters, self.defaults)
        proc = self.ecache[ttype]

        stream = proc.process(t, mapping)
        if self.minchunk:
            stream = util.increasingchunks(stream, min=self.minchunk,
                                           max=self.maxchunk)
        return stream