Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
87294835
Kaydet (Commit)
87294835
authored
Haz 16, 1998
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Some extra notes, and describe a new class (AddressList), all by ESR.
üst
4d4ab924
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
2 deletions
+44
-2
librfc822.tex
Doc/lib/librfc822.tex
+44
-2
No files found.
Doc/lib/librfc822.tex
Dosyayı görüntüle @
87294835
...
@@ -6,7 +6,8 @@
...
@@ -6,7 +6,8 @@
This module defines a class,
\class
{
Message
}
, which represents a
This module defines a class,
\class
{
Message
}
, which represents a
collection of ``email headers'' as defined by the Internet standard
collection of ``email headers'' as defined by the Internet standard
\rfc
{
822
}
. It is used in various contexts, usually to read such
\rfc
{
822
}
. It is used in various contexts, usually to read such
headers from a file.
headers from a file. This module also defines a helper class
\class
{
AddressList
}
for parsing RFC822 addresses.
Note that there's a separate module to read
\UNIX
{}
, MH, and MMDF
Note that there's a separate module to read
\UNIX
{}
, MH, and MMDF
style mailbox files:
\module
{
mailbox
}
\refstmodindex
{
mailbox
}
.
style mailbox files:
\module
{
mailbox
}
\refstmodindex
{
mailbox
}
.
...
@@ -42,6 +43,12 @@ e.g. \code{\var{m}['From']}, \code{\var{m}['from']} and
...
@@ -42,6 +43,12 @@ e.g. \code{\var{m}['From']}, \code{\var{m}['from']} and
\code
{
\var
{
m
}
['FROM']
}
all yield the same result.
\code
{
\var
{
m
}
['FROM']
}
all yield the same result.
\end{classdesc}
\end{classdesc}
\begin{classdesc}
{
AddressList
}{
field
}
You may instantiate the AddresssList helper class using a single
string parameter, a comma-separated list of RFC822 addresses to be
parsed. (The parameter None yields an empty list.)
\end{classdesc}
\begin{funcdesc}
{
parsedate
}{
date
}
\begin{funcdesc}
{
parsedate
}{
date
}
Attempts to parse a date according to the rules in
\rfc
{
822
}
.
Attempts to parse a date according to the rules in
\rfc
{
822
}
.
however, some mailers don't follow that format as specified, so
however, some mailers don't follow that format as specified, so
...
@@ -198,10 +205,45 @@ Finally, \class{Message} instances have two public instance variables:
...
@@ -198,10 +205,45 @@ Finally, \class{Message} instances have two public instance variables:
\begin{memberdesc}
{
headers
}
\begin{memberdesc}
{
headers
}
A list containing the entire set of header lines, in the order in
A list containing the entire set of header lines, in the order in
which they were read. Each line contains a trailing newline. The
which they were read (except that setitem calls may disturb this
order). Each line contains a trailing newline. The
blank line terminating the headers is not contained in the list.
blank line terminating the headers is not contained in the list.
\end{memberdesc}
\end{memberdesc}
\begin{memberdesc}
{
fp
}
\begin{memberdesc}
{
fp
}
The file object passed at instantiation time.
The file object passed at instantiation time.
\end{memberdesc}
\end{memberdesc}
\subsection
{
AddressList Objects
}
\label
{
addresslist-objects
}
An
\class
{
AddressList
}
instance has the following methods:
\begin{methoddesc}
{__
len
__}{
name
}
Return the number of addresses in the address list.
\end{methoddesc}
\begin{methoddesc}
{__
str
__}{
name
}
Return a canonicalized string representation of the address list.
Addresses are rendered in "name" <host@domain> form, comma-separated.
\end{methoddesc}
\begin{methoddesc}
{__
add
__}{
name
}
Return an AddressList instance that contains all addresses in both
AddressList operands, with duplicates removed (set union).
\end{methoddesc}
\begin{methoddesc}
{__
sub
__}{
name
}
Return an AddressList instance that contains every address in the
left-hand AddressList operand that is not present in the right-hand
address operand (set difference).
\end{methoddesc}
Finally,
\class
{
AddressList
}
instances have one public instance variable:
\begin{memberdesc}
{
addresslist
}
A list of tuple string pairs, one per address. In each member, the
first is the canonicalized name part of the address, the second is the
route-address (@-separated host-domain pair).
\end{memberdesc}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment