[REVIEW] tools: moved email_split function in emails section, instead of 'somwhere in the file'.

bzr revid: tde@openerp.com-20120828073414-lt4bpubxtv3235b6
This commit is contained in:
Thibault Delavallée 2012-08-28 09:34:14 +02:00
parent f386e2de33
commit bc5da1a02b
1 changed files with 5 additions and 0 deletions

View File

@ -395,6 +395,11 @@ def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=Non
cr.close()
return res
def email_split(text):
""" Return a list of the email addresses found in ``text`` """
if not text: return []
return re.findall(r'([^ ,<@]+@[^> ,]+)', text)
#----------------------------------------------------------
# SMS
#----------------------------------------------------------