def manage_main(self, REQUEST): """ """ options = { 'fs_path': resolve(self.pathspec), 'template_data': self._get_template()._text, } return self._manage_main(REQUEST, **options)
def manage_addDiskTemplate(self, id='', pathspec='', REQUEST=None): """ """ fs_path = resolve(pathspec) if not path.isfile(fs_path): raise ValueError("File not found %r (resolved to %r)" % (pathspec, fs_path)) if id == '': filename = path.basename(fs_path) id = path.splitext(filename)[0] ob = DiskTemplate(id, pathspec) self._setObject(id, ob) if REQUEST is not None: return self.manage_main(self, REQUEST, update_menu=1)
def _get_template(self): if not hasattr(self, '_v_template'): self._v_template = PageTemplateFile(resolve(self.pathspec)) return self._v_template