def read_template(self, filename): if filename.startswith('/'): path = filename else: path = self.template_abspath return slurp(path)
def read_template(self, filename): if filename.startswith('/'): path = filename else: path = join(TEMPLATES, '{}.{}'.format(filename, DEFAULT_TEMPLATE_EXT)) return slurp(path)
def corpus_loadfile(self): # TODO stream this, don't slurp it. text = slurp(self.args.path) return process_text(text, self.args.path, self.db)