VirtualMailManager/emailaddress.py
branchv0.6.x
changeset 341 6709d0faf2f5
parent 322 94bd10e237e5
child 366 d6573da35b5f
equal deleted inserted replaced
340:4515afec62e5 341:6709d0faf2f5
    66         address.  If so, it will assign the corresponding values to the
    66         address.  If so, it will assign the corresponding values to the
    67         attributes `_localpart` and `_domainname`."""
    67         attributes `_localpart` and `_domainname`."""
    68         parts = address.split('@')
    68         parts = address.split('@')
    69         p_len = len(parts)
    69         p_len = len(parts)
    70         if p_len < 2:
    70         if p_len < 2:
    71             raise EAErr(_(u"Missing the '@' sign in address %r") % address,
    71             raise EAErr(_(u"Missing the '@' sign in address '%s'") % address,
    72                         INVALID_ADDRESS)
    72                         INVALID_ADDRESS)
    73         elif p_len > 2:
    73         elif p_len > 2:
    74             raise EAErr(_(u"Too many '@' signs in address %r") % address,
    74             raise EAErr(_(u"Too many '@' signs in address '%s'") % address,
    75                         INVALID_ADDRESS)
    75                         INVALID_ADDRESS)
    76         if not parts[0]:
    76         if not parts[0]:
    77             raise EAErr(_(u'Missing local-part in address %r') % address,
    77             raise EAErr(_(u"Missing local-part in address '%s'") % address,
    78                         LOCALPART_INVALID)
    78                         LOCALPART_INVALID)
    79         if not parts[1]:
    79         if not parts[1]:
    80             raise EAErr(_(u'Missing domain name in address %r') % address,
    80             raise EAErr(_(u"Missing domain name in address '%s'") % address,
    81                         DOMAIN_NO_NAME)
    81                         DOMAIN_NO_NAME)
    82         self._localpart = check_localpart(parts[0])
    82         self._localpart = check_localpart(parts[0])
    83         self._domainname = check_domainname(parts[1])
    83         self._domainname = check_domainname(parts[1])
    84 
    84 
    85 
    85