Esempio n. 1
0
    def render(self, request):
        urls = list(self.urls)

        for path in self.paths:
            urls.append(static_url(request, self.resource, path))

        if self.type == 'css':
            s = '<link %shref="%s" />'
        else:
            s = '<script %ssrc="%s"> </script>'

        extra = ' '.join('%s="%s"'%(k,v) for k, v in self.extra.items())
        if extra:
            extra = '%s '%extra

        return '%s%s%s'%(
            self.prefix, '\n\n\t'.join(s%(extra, url) for url in urls),
            self.postfix)
Esempio n. 2
0
File: base.py Progetto: mcdonc/ptah
 def static_url(self, name, path=''):
     return static_url(name, path, self.request)