def read_template_file(self, filename, _context, _globals):
        if not self.preprocess:
            return open(filename).read()
        if _context is None:
            _context = {}
        if not _context.has_key('_engine'):
            self.hook_context(_context)
        if _globals is None:
            _globals = sys._getframe(2).f_globals
        preprocessor = Preprocessor(filename)
        return preprocessor.render(_context, globals=_globals)
dataset/ETHPy150Open rst2pdf/rst2pdf/rst2pdf/tenjin.py/Engine.read_template_file/original