l.a.v.email : module documentation

Part of lp.app.validators

EmailAdress validator
Function valid_email Validate an email address.
Function email_validator Raise a LaunchpadValidationError if the email is invalid.
def valid_email(emailaddr):

Validate an email address.

>>> valid_email('kiko.async@hotmail.com')
True
>>> valid_email('kiko+async@hotmail.com')
True
>>> valid_email('kiko-async@hotmail.com')
True
>>> valid_email('kiko_async@hotmail.com')
True
>>> valid_email('kiko@async.com.br')
True
>>> valid_email('kiko@canonical.com')
True
>>> valid_email('kiko@UBUNTU.COM')
True
>>> valid_email('i@tv')
True
>>> valid_email('kiko@gnu.info')
True
>>> valid_email('user@z.de')
True
>>> valid_email('bob=dobbs@example.com')
True
>>> valid_email('user@z..de')
False
>>> valid_email('user@.z.de')
False

As per OOPS-256D762:

>>> valid_email('keith@risby-family.co.uk')
True
>>> valid_email('keith@risby-family-.co.uk')
False
>>> valid_email('keith@-risby-family.co.uk')
False
def email_validator(emailaddr):

Raise a LaunchpadValidationError if the email is invalid.

Otherwise, return True.

>>> email_validator('bugs@example.com')
True
>>> email_validator('not-valid')
Traceback (most recent call last):
...
LaunchpadValidationError: Invalid email 'not-valid'.
API Documentation for Launchpad, generated by pydoctor at 2018-02-25 00:00:04.