doc/source/vmm_emailaddress.rst
author Pascal Volk <neverseen@users.sourceforge.net>
Thu, 25 Feb 2010 17:56:08 +0000
branchv0.6.x
changeset 215 33f727efa7c4
parent 212 77ac6f572855
child 216 0c8c053b451c
permissions -rw-r--r--
PEP-8-ified the work of the last days. Renamed methods in class Alias: addDestination() -> add_destination() delDestination() -> del_destination() getDestinations() -> get_destinations() Renamed methods in class Relocated: setDestination() -> set_destination() getInfo() -> get_info() Renamed VMM/constants/VERSION.py -> VMM/constants/version.py Adjusted relevant parts of the documentation.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
212
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     1
:mod:`VirtualMailManager.EmailAddress` --- Handling of e-mail addresses
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     2
=======================================================================
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     3
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     4
.. module:: VirtualMailManager.EmailAddress
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     5
  :synopsis: Handling of e-mail addresses
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     6
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     7
.. moduleauthor:: Pascal Volk <neverseen@users.sourceforge.net>
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     8
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
     9
.. toctree::
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    10
   :maxdepth: 2
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    11
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    12
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    13
This module provides the :class:`EmailAddress` class to handle validated e-mail
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    14
addresses.
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    15
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    16
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    17
EmailAddress
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    18
------------
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    19
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    20
.. class:: EmailAddress(address)
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    21
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    22
  Creates a new EmailAddress instance.
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    23
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    24
  :param address: string representation of an e-mail addresses
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    25
  :type address: :obj:`basestring`
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    26
  :raise VirtualMailManager.Exceptions.VMMEmailAddressException: if the
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    27
    *address* is syntactically wrong.
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    28
  :raise VirtualMailManager.Exceptions.VMMException: if the validation of the
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    29
    local-part or domain name fails.
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    30
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    31
  An EmailAddress instance has the both read-only attributes:
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    32
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    33
  .. attribute:: localpart
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    34
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    35
    The local-part of the address *local-part@domain*
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    36
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    37
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    38
  .. attribute:: domainname
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    39
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    40
    The domain part of the address *local-part@domain*
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    41
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    42
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    43
Examples
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    44
--------
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    45
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    46
  >>> from VirtualMailManager.EmailAddress import EmailAddress
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    47
  >>> john = EmailAddress('john.doe@example.com')
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    48
  >>> john.localpart
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    49
  'john.doe'
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    50
  >>> john.domainname
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    51
  'example.com'
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    52
  >>> jane = EmailAddress('jane.doe@example.com')
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    53
  >>> jane != john
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    54
  True
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    55
  >>> EmailAddress('info@xn--pypal-4ve.tld') == EmailAddress(u'info@pŠ°ypal.tld')
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    56
  True
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    57
  >>> jane
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    58
  EmailAddress('jane.doe@example.com')
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    59
  >>> print john
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    60
  john.doe@example.com
77ac6f572855 doc: extended documentation.
Pascal Volk <neverseen@users.sourceforge.net>
parents:
diff changeset
    61
  >>>