Ejemplo n.º 1
0
 def manage_main(self, REQUEST):
     """ """
     options = {
         'fs_path': resolve(self.pathspec),
         'template_data': self._get_template()._text,
     }
     return self._manage_main(REQUEST, **options)
Ejemplo n.º 2
0
 def manage_main(self, REQUEST):
     """ """
     options = {
         'fs_path': resolve(self.pathspec),
         'template_data': self._get_template()._text,
     }
     return self._manage_main(REQUEST, **options)
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
 def _get_template(self):
     if not hasattr(self, '_v_template'):
         self._v_template = PageTemplateFile(resolve(self.pathspec))
     return self._v_template
Ejemplo n.º 6
0
 def _get_template(self):
     if not hasattr(self, '_v_template'):
         self._v_template = PageTemplateFile(resolve(self.pathspec))
     return self._v_template