Exemplo n.º 1
0
 def resources(self):
     css = getUtility(IHTTPRoot, 'css')
     for resid in self._resources:
         if resid in css.children:
             resource = IWebResource(css)
             resource.update(dict(path=resid,
                                  resource=css.children[resid]))
             if resid in self._res_meta:
                 resource.update(self._res_meta[resid])
             yield resource
Exemplo n.º 2
0
 def resources(self):
     js = getUtility(IHTTPRoot, 'js')
     for _resid in self._resources:
         parts = _resid.split('/')
         resid = parts.pop()
         folder = js
         if len(parts):
             for part in parts:
                 if part in folder.children:
                     folder = folder.children[part]
         if resid in folder.children:
             resource = IWebResource(js)
             resource.update(dict(path=_resid,
                                  resource=folder.children[resid]))
             if resid in self._res_meta:
                 resource.update(self._res_meta[resid])
             yield resource