def __init__(self, res, **kwargs): Resource.__init__(self, **kwargs) self.category = 'resource' self.is_leaf = True self.folderish = False # initialize REST resource either via dictionary or a given resource if isinstance(res, dict): self.package_id = res['package_id'] self.resourcetype_id = res['resourcetype_id'] self.name = res['resource_name'] self.revision = res['revision'] self.res = None self.meta = res else: self.package_id = res.package.package_id self.resourcetype_id = res.resourcetype.resourcetype_id self.name = res.name self.revision = res.document.revision self.res = res meta = self.res.document.meta self.meta = { 'meta_size': meta.size, 'meta_uid': meta.uid, 'meta_datetime': meta.datetime } # set url self.url = "/xml/%s/%s/%s" % (self.package_id, self.resourcetype_id, self.name)
def __init__(self, path, default_type="text/html", registry=None, processors={ '.epy': PythonScript, '.rpy': ResourceScript }, **kwargs): Resource.__init__(self, **kwargs) filepath.FilePath.__init__(self, path) # folder or file? self.restat() if self.isdir(): self.category = 'folder' self.is_leaf = False self.folderish = True else: self.category = 'file' self.is_leaf = True self.folderish = False # content type self.default_type = default_type # a registry for cached file based scripts self.registry = registry or static.Registry() # allowed processors self.processors = processors
def __init__(self, package_id, resourcetype_id, name, revision=None, **kwargs): Resource.__init__(self, **kwargs) self.is_leaf = True self.folderish = False self.package_id = package_id self.resourcetype_id = resourcetype_id self.name = name self.revision = revision
def __init__(self, root, panel, **kwargs): Resource.__init__(self, **kwargs) self.is_leaf = True self.category = 'admin' self.folderish = False self.panel = panel self.public = self.panel.public self.panel.root = root self.root = root self.cid, _, self.pid, _ = self.panel.panel_ids
def __init__(self, root, panels, **kwargs): Resource.__init__(self, **kwargs) self.public = True self.category = 'admin' self.root = root self.panels = panels # get all admin sub panels for panel in panels: # create child id = panel.panel_ids[2] self.putChild(id, AdminPanel(root, panel))
def __init__(self, mapper, folderish=False, **kwargs): Resource.__init__(self, **kwargs) self.is_leaf = True self.mapper = mapper if hasattr(mapper, 'public'): self.public = True if folderish: self.folderish = True self.category = 'mapping-folder' else: self.folderish = False self.category = 'mapping'
def __init__(self, env, **kwargs): Resource.__init__(self, **kwargs) self.public = True self.env = env self.category = 'admin' # default template dir self.template_dir = os.path.join(self.env.getPackagePath(), 'seishub', 'core', 'packages', 'admin', 'web', 'templates') # default template dir self.statics_dir = os.path.join(self.env.getPackagePath(), 'seishub', 'core', 'packages', 'admin', 'web', 'statics') # register themes, panels and static content self._registerAdminThemes() self._registerAdminPanels() self._registerStaticContent()
def __init__(self, path, default_type="text/html", registry=None, processors={'.epy': PythonScript, '.rpy': ResourceScript}, **kwargs): Resource.__init__(self, **kwargs) filepath.FilePath.__init__(self, path) # folder or file? self.restat() if self.isdir(): self.category = 'folder' self.is_leaf = False self.folderish = True else: self.category = 'file' self.is_leaf = True self.folderish = False # content type self.default_type = default_type # a registry for cached file based scripts self.registry = registry or static.Registry() # allowed processors self.processors = processors
def __init__(self, **kwargs): Resource.__init__(self, **kwargs) self.category = 'index' self.is_leaf = True self.folderish = False
def __init__(self, expr, **kwargs): Resource.__init__(self, **kwargs) self.is_leaf = True self.folderish = True self.category = 'alias' self.expr = expr