def __init__(self, key, packbund, username=None, password=None): Wrapped.__init__(self, packbund=packbund, activity='com.nukona.WebVille.WebVilleActivity', username=username, password=password) self._key = key
def data(self, thing): edit_date = time.mktime(thing.edit_date.timetuple()) if thing.edit_date else None edit_by = None if thing.edit_by and not thing.edit_by._deleted: edit_by = Wrapped(thing.edit_by).render() return dict(content_md=thing.page_content_md, content_html=thing.page_content, revision_by=edit_by, revision_date=edit_date, may_revise=thing.may_revise)
def render(self, thing, *a, **kw): timestamp = time.mktime(thing.date.timetuple()) if thing.date else None author = thing.get_author() if author and not author._deleted: author = Wrapped(author).render() else: author = None return ObjectTemplate(dict(author=author, id=str(thing._id), timestamp=timestamp, reason=thing._get('reason'), page=thing.page))
def __init__(self, translator, sing, plural = '', message = '', enabled = True, locale = '', tip = ''): Wrapped.__init__(self, self) self.translator = translator self.message = message self.enabled = enabled self.locale = locale self.tip = '' # figure out where this item appears in the source source = source_line.findall(message) if source: self.source, self.line = source[0] else: self.source = self.line = '' self.msgid = self._SubstString(sing) self.msgid_plural = self._SubstString(plural) if str(self.msgid_plural): self.msgstr = [] else: self.msgstr = self._SubstString('')
def data(self, thing): editors = [Wrapped(e).render() for e in thing.mayedit] return dict(permlevel=thing.permlevel, editors=editors)
def data(self, trophies): trophies = [Wrapped(t).render() for t in trophies] return dict(trophies=trophies)
def render(self, **kw): """Using the canonical template file, only renders the <%def> in the template whose name is given by self.style""" style = kw.get('style', c.render_style or 'html') return Wrapped.part_render(self, self.style, style = style, **kw)
def __init__(self, style, _id = '', css_class = '', **kw): self._id = _id self.css_class = css_class self.style = style Wrapped.__init__(self, **kw)
def render(self, **kw): """Using the canonical template file, only renders the <%def> in the template whose name is given by self.style""" style = kw.get('style', c.render_style or 'html') return Wrapped.part_render(self, self.style, style=style, **kw)
def __init__(self, style, _id='', css_class='', **kw): self._id = _id self.css_class = css_class self.style = style Wrapped.__init__(self, **kw)
def startup_once(self, param=None): Wrapped.startup_once(self, param=param) time.sleep(5) return self