Beispiel #1
0
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)
Beispiel #2
0
 def name(self):
     """Template name."""
     return ffi.string(lib.EnvGetDeftemplateName(self._env,
                                                 self._tpl)).decode()