Exemplo n.º 1
0
def __get_page_review(email_cnt, idx):
    '''
    Review for pages.
    '''
    recent_posts = MWiki.query_recent_edited(tools.timestamp() - TIME_LIMIT)
    for recent_post in recent_posts:
        hist_rec = MWikiHist.get_last(recent_post.uid)
        if hist_rec:
            foo_str = '''
                    <tr><td>{0}</td><td>{1}</td><td class="diff_chg">Edit</td><td>{2}</td>
                    <td><a href="{3}">{3}</a></td></tr>
                    '''.format(
                idx, recent_post.user_name, recent_post.title,
                os.path.join(SITE_CFG['site_url'], 'wiki', recent_post.title))
            email_cnt = email_cnt + foo_str
        else:
            foo_str = '''
                    <tr><td>{0}</td><td>{1}</td><td class="diff_add">New </td><td>{2}</td>
                    <td><a href="{3}">{3}</a></td></tr>
                    '''.format(
                idx, recent_post.user_name, recent_post.title,
                os.path.join(SITE_CFG['site_url'], 'wiki', recent_post.title))
            email_cnt = email_cnt + foo_str
        idx = idx + 1

    return email_cnt, idx
Exemplo n.º 2
0
 def test_get_last(self):
     self.add_w_h()
     aa = MWikiHist.get_last(self.wiki_uid)
     assert aa.uid == self.uid
     self.tearDown()
Exemplo n.º 3
0
 def test_get_last(self):
     MWikiHist.get_last(self.userinfo['postid'])
     assert True
Exemplo n.º 4
0
 def test_get_last(self):
     MWikiHist.get_last(self.postid)
     assert True