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