def template_pp_string(env, template): strn = lib.EnvGetDeftemplatePPForm(env, template) if strn != ffi.NULL: return ffi.string(strn).decode().strip() else: module = ffi.string(lib.EnvDeftemplateModule(env, template)).decode() name = ffi.string(lib.EnvGetDeftemplateName(env, template)).decode() return '(deftemplate %s::%s)' % (module, name)
def name(self): """Template name.""" return ffi.string(lib.EnvGetDeftemplateName(self._env, self._tpl)).decode()