def renderHTTP(self,ctx): args, kwargs = self.getExtraData(ctx)['template'] if len(args) == 0: self.docFactory = skin.loader("Page.html") else: self.docFactory = skin.loader("Page-%s.html" % (args[0],)) return super(PageResource,self).renderHTTP(ctx)
def renderer(ctx, data): # If it looks like a filename then load a skin, otherwise look for a # named fragment. if '.' in name: fragment = skin.loader(name, ignoreDocType=True) else: fragment = getattr(self, 'fragment_%s'%name) return fragment
def __init__(self, avatar, product, basketURL, template, baseURL=None): super(ProductFragment, self).__init__() self.avatar = avatar self.product = product self.basketURL = basketURL self.baseURL = url.here self.docFactory = skin.loader(template,ignoreDocType=True)
def renderer(ctx, data): # Load the template # template = tags.invisible[skin.loader(name, ignoreDocType=True)] template = tags.invisible[skin.loader(name)] # Fill the inherited template's slots with any available patterns. for filler in stan.specials(ctx.tag, 'pattern'): template.fillSlots( filler._specials['pattern'], inevow.IQ(ctx.tag).allPatterns(filler._specials['pattern']) ) return template
def __init__(self, avatar, storeSession, baseURL, basketURL, filters=None, data=None, fragmenttemplate=None, browsertemplate=None): super(ProductBrowserFragment, self).__init__() self.avatar = avatar self.storeSession = storeSession self.baseURL = baseURL self.basketURL = basketURL self.filters = filters self.data = data if fragmenttemplate is not None: self.fragmenttemplate = fragmenttemplate if browsertemplate is not None: self.docFactory = skin.loader(browsertemplate) self.item = []
def setTemplate(self, args, kwargs): if args: self.docFactory = skin.loader("Page-%s.html" % (args[0],))
def setTemplate(self, args, kwargs): if len(args) > 0: self.docFactory = skin.loader("NewsItem-%s.html" % (args[0],))
def __init__(self, template): self.docFactory = skin.loader(template, ignoreDocType=True)
def renderHTTP(self,ctx): large = ctx.arg('large',None) if large is not None: self.docFactory = skin.loader('Photo-zoom.html') return super(Photo, self).renderHTTP(ctx)