Skip to content

Commit

Permalink
Merge pull request #80 from mailgun/sergey/12
Browse files Browse the repository at this point in the history
fixes #12
  • Loading branch information
obukhov-sergey committed Mar 4, 2016
2 parents 3497b5c + 02adf53 commit f3c0942
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


setup(name='talon',
version='1.2.4',
version='1.2.5',
description=("Mailgun library "
"to extract message quotations and signatures."),
long_description=open("README.rst").read(),
Expand Down
4 changes: 3 additions & 1 deletion talon/quotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@
re.compile("\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}\s+GMT.*@", re.S),
# Thu, 26 Jun 2014 14:00:51 +0400 Bob <bob@example.com>:
re.compile('\S{3,10}, \d\d? \S{3,10} 20\d\d,? \d\d?:\d\d(:\d\d)?'
'( \S+){3,6}@\S+:')
'( \S+){3,6}@\S+:'),
# Sent from Samsung MobileName <address@example.com> wrote:
re.compile('Sent from Samsung .*@.*> wrote')
]


Expand Down
13 changes: 13 additions & 0 deletions tests/text_quotations_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ def test_pattern_on_date_somebody_wrote():
eq_("Test reply", quotations.extract_from_plain(msg_body))


def test_pattern_sent_from_samsung_smb_wrote():
msg_body = """Test reply
Sent from Samsung MobileName <address@example.com> wrote:
>
> Test
>
> Roman"""

eq_("Test reply", quotations.extract_from_plain(msg_body))


def test_pattern_on_date_wrote_somebody():
eq_('Lorem', quotations.extract_from_plain(
"""Lorem
Expand Down

0 comments on commit f3c0942

Please sign in to comment.