コード例 #1
0
ファイル: test_mailsplit.py プロジェクト: sgala/roundup
    def testPostComment(self):
        s = '''
[email protected] wrote:
> blah blah blah blahblah blahblah blahblah blah blah blah blah blah
> blah
> blah blah blah blah blah blah blah blah blah?  blah blah blah blah
> blah
> blah blah blah blah blah blah blah...  blah blah blah blah.  blah
> blah
> blah blah blah blah?  blah blah blah blah blah blah!  blah blah!
>
> -------
> nosy: userfoo, userken
> _________________________________________________
> Roundup issue tracker
> [email protected]
> http://foo.com/cgi-bin/roundup.cgi/issue_tracker/

blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah
blah blah blah blah blah blah blah blah blah blah blah!

--
blah blah blah signature
[email protected]
'''
        summary, content = parseContent(s, 0, 0)
        self.assertEqual(summary, 'blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah')
        self.assertEqual(content, 'blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah\nblah blah blah blah blah blah blah blah blah blah blah!')
コード例 #2
0
ファイル: test_mailsplit.py プロジェクト: willingc/roundup
    def testKeepMultipleHyphens(self):
        body = '''Testing, testing.

----
Testing, testing.'''
        summary, content = parseContent(body, 1, 0)
        self.assertEqual(body, content)
コード例 #3
0
ファイル: test_mailsplit.py プロジェクト: sgala/roundup
    def testKeepMultipleHyphens(self):
        body = '''Testing, testing.

----
Testing, testing.'''
        summary, content = parseContent(body, 1, 0)
        self.assertEqual(body, content)
コード例 #4
0
ファイル: test_mailsplit.py プロジェクト: willingc/roundup
    def testPostComment(self):
        s = '''
[email protected] wrote:
> blah blah blah blahblah blahblah blahblah blah blah blah blah blah
> blah
> blah blah blah blah blah blah blah blah blah?  blah blah blah blah
> blah
> blah blah blah blah blah blah blah...  blah blah blah blah.  blah
> blah
> blah blah blah blah?  blah blah blah blah blah blah!  blah blah!
>
> -------
> nosy: userfoo, userken
> _________________________________________________
> Roundup issue tracker
> [email protected]
> http://foo.com/cgi-bin/roundup.cgi/issue_tracker/

blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah
blah blah blah blah blah blah blah blah blah blah blah!

--
blah blah blah signature
[email protected]
'''
        summary, content = parseContent(s, 0, 0)
        self.assertEqual(
            summary,
            'blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah'
        )
        self.assertEqual(
            content,
            'blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah\nblah blah blah blah blah blah blah blah blah blah blah!'
        )
コード例 #5
0
def summarygenerator(db, cl, nodeid, newvalues):
    """ If the message doesn't have a summary, make one for it.
    """
    if newvalues.has_key("summary") or not newvalues.has_key("content"):
        return

    summary, content = parseContent(newvalues["content"], config=db.config)
    newvalues["summary"] = summary
コード例 #6
0
ファイル: messagesummary.py プロジェクト: willingc/roundup
def summarygenerator(db, cl, nodeid, newvalues):
    ''' If the message doesn't have a summary, make one for it.
    '''
    if 'summary' in newvalues or 'content' not in newvalues:
        return

    summary, content = parseContent(newvalues['content'], config=db.config)
    newvalues['summary'] = summary
コード例 #7
0
ファイル: messagesummary.py プロジェクト: balrog-kun/remonty
def summarygenerator(db, cl, nodeid, newvalues):
    ''' If the message doesn't have a summary, make one for it.
    '''
    if newvalues.has_key('summary') or not newvalues.has_key('content'):
        return

    summary, content = parseContent(newvalues['content'], config=db.config)
    newvalues['summary'] = summary
コード例 #8
0
def summarygenerator(db, cl, nodeid, newvalues):
    ''' If the message doesn't have a summary, make one for it.
    '''
    if newvalues.has_key('summary') or not newvalues.has_key('content'):
        return

    summary, content = parseContent(newvalues['content'], 1, 1)
    newvalues['summary'] = summary
コード例 #9
0
ファイル: test_mailsplit.py プロジェクト: willingc/roundup
    def testKeepCitation(self):
        s = '''
blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah
blah blah blah blah blah blah blah blah blah blah blah!

[email protected] wrote:
> blah blah blah blahblah blahblah blahblah blah blah blah blah blah blah
> blah blah blah blah blah blah blah blah blah?  blah blah blah blah blah
> blah blah blah blah blah blah blah...  blah blah blah blah.  blah blah
> blah blah blah blah?  blah blah blah blah blah blah!  blah blah!
>
> -------
> nosy: userfoo, userken
> _________________________________________________
> Roundup issue tracker
> [email protected]
> http://foo.com/cgi-bin/roundup.cgi/issue_tracker/

--
blah blah blah signature
[email protected]
'''
        summary, content = parseContent(s, 1, 0)
        self.assertEqual(
            summary,
            'blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah'
        )
        self.assertEqual(
            content, '''\
blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah
blah blah blah blah blah blah blah blah blah blah blah!

[email protected] wrote:
> blah blah blah blahblah blahblah blahblah blah blah blah blah blah blah
> blah blah blah blah blah blah blah blah blah?  blah blah blah blah blah
> blah blah blah blah blah blah blah...  blah blah blah blah.  blah blah
> blah blah blah blah?  blah blah blah blah blah blah!  blah blah!
>
> -------
> nosy: userfoo, userken
> _________________________________________________
> Roundup issue tracker
> [email protected]
> http://foo.com/cgi-bin/roundup.cgi/issue_tracker/''')
コード例 #10
0
ファイル: test_mailsplit.py プロジェクト: sgala/roundup
    def testKeepCitation(self):
        s = '''
blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah
blah blah blah blah blah blah blah blah blah blah blah!

[email protected] wrote:
> blah blah blah blahblah blahblah blahblah blah blah blah blah blah blah
> blah blah blah blah blah blah blah blah blah?  blah blah blah blah blah
> blah blah blah blah blah blah blah...  blah blah blah blah.  blah blah
> blah blah blah blah?  blah blah blah blah blah blah!  blah blah!
>
> -------
> nosy: userfoo, userken
> _________________________________________________
> Roundup issue tracker
> [email protected]
> http://foo.com/cgi-bin/roundup.cgi/issue_tracker/

--
blah blah blah signature
[email protected]
'''
        summary, content = parseContent(s, 1, 0)
        self.assertEqual(summary, 'blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah')
        self.assertEqual(content, '''\
blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah
blah blah blah blah blah blah blah blah blah blah blah!

[email protected] wrote:
> blah blah blah blahblah blahblah blahblah blah blah blah blah blah blah
> blah blah blah blah blah blah blah blah blah?  blah blah blah blah blah
> blah blah blah blah blah blah blah...  blah blah blah blah.  blah blah
> blah blah blah blah?  blah blah blah blah blah blah!  blah blah!
>
> -------
> nosy: userfoo, userken
> _________________________________________________
> Roundup issue tracker
> [email protected]
> http://foo.com/cgi-bin/roundup.cgi/issue_tracker/''')
コード例 #11
0
ファイル: test_mailsplit.py プロジェクト: sgala/roundup
 def testSimple(self):
     s = '''testing'''
     summary, content = parseContent(s, 0, 0)
     self.assertEqual(summary, 'testing')
     self.assertEqual(content, 'testing')
コード例 #12
0
ファイル: test_mailsplit.py プロジェクト: willingc/roundup
 def testMultilineSummary(self):
     s = 'This is a long sentence that would normally\nbe split. More words.'
     summary, content = parseContent(s, 0, 0)
     self.assertEqual(
         summary, 'This is a long sentence that would '
         'normally\nbe split.')
コード例 #13
0
ファイル: test_mailsplit.py プロジェクト: willingc/roundup
 def testIndentationContent(self):
     s = '    Four space indent.\n\n    Four space indent.\nNo indent.'
     summary, content = parseContent(s, 0, 0)
     self.assertEqual(content, s)
コード例 #14
0
ファイル: test_mailsplit.py プロジェクト: willingc/roundup
 def testEmpty(self):
     s = ''
     summary, content = parseContent(s, 0, 0)
     self.assertEqual(summary, '')
     self.assertEqual(content, '')
コード例 #15
0
ファイル: test_mailsplit.py プロジェクト: willingc/roundup
 def testSimpleFollowupParas(self):
     s = '''>hello\ntesting\n\ntesting\n\ntesting'''
     summary, content = parseContent(s, 0, 0)
     self.assertEqual(summary, 'testing')
     self.assertEqual(content, 'testing\n\ntesting\n\ntesting')
コード例 #16
0
ファイル: test_mailsplit.py プロジェクト: willingc/roundup
 def testParagraphs(self):
     s = '''testing\n\ntesting\n\ntesting'''
     summary, content = parseContent(s, 0, 0)
     self.assertEqual(summary, 'testing')
     self.assertEqual(content, 'testing\n\ntesting\n\ntesting')
コード例 #17
0
ファイル: test_mailsplit.py プロジェクト: willingc/roundup
 def testSimple(self):
     s = '''testing'''
     summary, content = parseContent(s, 0, 0)
     self.assertEqual(summary, 'testing')
     self.assertEqual(content, 'testing')
コード例 #18
0
ファイル: test_mailsplit.py プロジェクト: sgala/roundup
 def testIndentationContent(self):
     s = '    Four space indent.\n\n    Four space indent.\nNo indent.'
     summary, content = parseContent(s, 0, 0)
     self.assertEqual(content, s)
コード例 #19
0
ファイル: test_mailsplit.py プロジェクト: sgala/roundup
 def testAllQuoted(self):
     s = '\[email protected] wrote:\n> testing\n'
     summary, content = parseContent(s, 0, 1)
     self.assertEqual(summary, '')
     self.assertEqual(content, s)
コード例 #20
0
ファイル: test_mailsplit.py プロジェクト: sgala/roundup
 def testMultilineSummary(self):
     s = 'This is a long sentence that would normally\nbe split. More words.'
     summary, content = parseContent(s, 0, 0)
     self.assertEqual(summary, 'This is a long sentence that would '
         'normally\nbe split.')
コード例 #21
0
def audit_message(db, c, nodeid, newvalues):
    if newvalues.has_key('summary') or not newvalues.has_key('content'):
        return
    summary, _content = parseContent(newvalues['content'], 1, 1)
    newvalues['summary'] = summary
コード例 #22
0
ファイル: test_mailsplit.py プロジェクト: sgala/roundup
 def testParagraphs(self):
     s = '''testing\n\ntesting\n\ntesting'''
     summary, content = parseContent(s, 0, 0)
     self.assertEqual(summary, 'testing')
     self.assertEqual(content, 'testing\n\ntesting\n\ntesting')
コード例 #23
0
ファイル: test_mailsplit.py プロジェクト: sgala/roundup
 def testSimpleFollowupParas(self):
     s = '''>hello\ntesting\n\ntesting\n\ntesting'''
     summary, content = parseContent(s, 0, 0)
     self.assertEqual(summary, 'testing')
     self.assertEqual(content, 'testing\n\ntesting\n\ntesting')
コード例 #24
0
ファイル: test_mailsplit.py プロジェクト: willingc/roundup
 def testAllQuoted(self):
     s = '\[email protected] wrote:\n> testing\n'
     summary, content = parseContent(s, 0, 1)
     self.assertEqual(summary, '')
     self.assertEqual(content, s)
コード例 #25
0
ファイル: test_mailsplit.py プロジェクト: sgala/roundup
 def testEmpty(self):
     s = ''
     summary, content = parseContent(s, 0, 0)
     self.assertEqual(summary, '')
     self.assertEqual(content, '')