예제 #1
0
파일: swa.py 프로젝트: hirekatsu/arch
 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
예제 #2
0
 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)
예제 #3
0
 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))
예제 #4
0
    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('')
예제 #5
0
 def data(self, thing):
     editors = [Wrapped(e).render() for e in thing.mayedit]
     return dict(permlevel=thing.permlevel,
                 editors=editors)
예제 #6
0
 def data(self, trophies):
     trophies = [Wrapped(t).render() for t in trophies]
     return dict(trophies=trophies)
예제 #7
0
 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)
예제 #8
0
 def __init__(self, style, _id = '', css_class = '', **kw):
     self._id = _id
     self.css_class = css_class
     self.style = style
     Wrapped.__init__(self, **kw)
예제 #9
0
 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)
예제 #10
0
 def __init__(self, style, _id='', css_class='', **kw):
     self._id = _id
     self.css_class = css_class
     self.style = style
     Wrapped.__init__(self, **kw)
예제 #11
0
파일: swa.py 프로젝트: hirekatsu/arch
 def startup_once(self, param=None):
     Wrapped.startup_once(self, param=param)
     time.sleep(5)
     return self