| | |
- AddrlistClass
-
- AddressList
class AddressList(AddrlistClass) |
| |
An AddressList encapsulates a list of parsed RFC 2822 addresses. |
| |
Methods defined here:
- __add__(self, other)
- __getitem__(self, index)
- __iadd__(self, other)
- __init__(self, field)
- __isub__(self, other)
- __len__(self)
- __sub__(self, other)
Methods inherited from AddrlistClass:
- getaddress(self)
- Parse the next address.
- getaddrlist(self)
- Parse all addresses.
Returns a list containing all of the addresses.
- getaddrspec(self)
- Parse an RFC 2822 addr-spec.
- getatom(self, atomends=None)
- Parse an RFC 2822 atom.
Optional atomends specifies a different set of end token delimiters
(the default is to use self.atomends). This is used e.g. in
getphraselist() since phrase endings must not include the `.' (which
is legal in phrases).
- getcomment(self)
- Get a parenthesis-delimited fragment from self's field.
- getdelimited(self, beginchar, endchars, allowcomments=True)
- Parse a header fragment delimited by special characters.
`beginchar' is the start character for the fragment.
If self is not looking at an instance of `beginchar' then
getdelimited returns the empty string.
`endchars' is a sequence of allowable end-delimiting characters.
Parsing stops when one of these is encountered.
If `allowcomments' is non-zero, embedded RFC 2822 comments are allowed
within the parsed fragment.
- getdomain(self)
- Get the complete domain name from an address.
- getdomainliteral(self)
- Parse an RFC 2822 domain-literal.
- getphraselist(self)
- Parse a sequence of RFC 2822 phrases.
A phrase is a sequence of words, which are in turn either RFC 2822
atoms or quoted-strings. Phrases are canonicalized by squeezing all
runs of continuous whitespace into one space.
- getquote(self)
- Get a quote-delimited fragment from self's field.
- getrouteaddr(self)
- Parse a route address (Return-path value).
This method just skips all the route stuff and returns the addrspec.
- gotonext(self)
- Parse up to the start of the next address.
|
class AddrlistClass |
| |
Address parser class by Ben Escoto.
To understand what this class does, it helps to have a copy of RFC 2822 in
front of you.
Note: this class interface is deprecated and may be removed in the future.
Use rfc822.AddressList instead. |
| |
Methods defined here:
- __init__(self, field)
- Initialize a new instance.
`field' is an unparsed address header field, containing
one or more addresses.
- getaddress(self)
- Parse the next address.
- getaddrlist(self)
- Parse all addresses.
Returns a list containing all of the addresses.
- getaddrspec(self)
- Parse an RFC 2822 addr-spec.
- getatom(self, atomends=None)
- Parse an RFC 2822 atom.
Optional atomends specifies a different set of end token delimiters
(the default is to use self.atomends). This is used e.g. in
getphraselist() since phrase endings must not include the `.' (which
is legal in phrases).
- getcomment(self)
- Get a parenthesis-delimited fragment from self's field.
- getdelimited(self, beginchar, endchars, allowcomments=True)
- Parse a header fragment delimited by special characters.
`beginchar' is the start character for the fragment.
If self is not looking at an instance of `beginchar' then
getdelimited returns the empty string.
`endchars' is a sequence of allowable end-delimiting characters.
Parsing stops when one of these is encountered.
If `allowcomments' is non-zero, embedded RFC 2822 comments are allowed
within the parsed fragment.
- getdomain(self)
- Get the complete domain name from an address.
- getdomainliteral(self)
- Parse an RFC 2822 domain-literal.
- getphraselist(self)
- Parse a sequence of RFC 2822 phrases.
A phrase is a sequence of words, which are in turn either RFC 2822
atoms or quoted-strings. Phrases are canonicalized by squeezing all
runs of continuous whitespace into one space.
- getquote(self)
- Get a quote-delimited fragment from self's field.
- getrouteaddr(self)
- Parse a route address (Return-path value).
This method just skips all the route stuff and returns the addrspec.
- gotonext(self)
- Parse up to the start of the next address.
| |