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
23329d41
Kaydet (Commit)
23329d41
authored
Agu 10, 1998
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Some logical markup, some nits.
üst
20392ccb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
25 deletions
+26
-25
librfc822.tex
Doc/lib/librfc822.tex
+26
-25
No files found.
Doc/lib/librfc822.tex
Dosyayı görüntüle @
23329d41
...
@@ -3,8 +3,6 @@
...
@@ -3,8 +3,6 @@
\modulesynopsis
{
Parse
\rfc
{
822
}
style mail headers.
}
\modulesynopsis
{
Parse
\rfc
{
822
}
style mail headers.
}
%\index{RFC!RFC 822}
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
...
@@ -17,38 +15,41 @@ style mailbox files: \module{mailbox}\refstmodindex{mailbox}.
...
@@ -17,38 +15,41 @@ style mailbox files: \module{mailbox}\refstmodindex{mailbox}.
\begin{classdesc}
{
Message
}{
file
\optional
{
, seekable
}}
\begin{classdesc}
{
Message
}{
file
\optional
{
, seekable
}}
A
\class
{
Message
}
instance is instantiated with an input object as
A
\class
{
Message
}
instance is instantiated with an input object as
parameter. Message relies only on the input object having a
parameter. Message relies only on the input object having a
\code
{
readline
}
method; in particular, ordinary file objects qualify.
\method
{
readline()
}
method; in particular, ordinary file objects
Instantiation reads headers from the input object up to a delimiter
qualify. Instantiation reads headers from the input object up to a
line (normally a blank line) and stores them in the instance.
delimiter line (normally a blank line) and stores them in the
instance.
This class can work with any input object that supports a readline
method. If the input object has seek and tell capability, the
This class can work with any input object that supports a
\code
{
rewindbody
}
method will work; also, illegal lines will be pushed back
\method
{
readline()
}
method. If the input object has seek and tell
onto the input stream. If the input object lacks seek but has an
capability, the
\method
{
rewindbody()
}
method will work; also, illegal
\code
{
unread
}
method that can push back a line of input, Message will use
lines will be pushed back onto the input stream. If the input object
that to push back illegal lines. Thus this class can be used to parse
lacks seek but has an
\method
{
unread()
}
method that can push back a
messages coming from a buffered stream.
line of input,
\class
{
Message
}
will use that to push back illegal
lines. Thus this class can be used to parse messages coming from a
The optional
\code
{
seekable
}
argument is provided as a workaround for
buffered stream.
certain stdio libraries in which tell() discards buffered data before
discovering that the
\code
{
lseek()
}
system call doesn't work. For
The optional
\var
{
seekable
}
argument is provided as a workaround for
maximum portability, you should set the seekable argument to zero to
certain stdio libraries in which
\cfunction
{
tell()
}
discards buffered
prevent that initial
\code
{
tell
}
when passing in an unseekable object
data before discovering that the
\cfunction
{
lseek()
}
system call
such as a a file object created from a socket object.
doesn't work. For maximum portability, you should set the seekable
argument to zero to prevent that initial
\method
{
tell()
}
when passing
in an unseekable object such as a a file object created from a socket
object.
Input lines as read from the file may either be terminated by CR-LF or
Input lines as read from the file may either be terminated by CR-LF or
by a single linefeed; a terminating CR-LF is replaced by a single
by a single linefeed; a terminating CR-LF is replaced by a single
linefeed before the line is stored.
linefeed before the line is stored.
All header matching is done independent of upper or lower case;
All header matching is done independent of upper or lower case;
e.g.
\code
{
\var
{
m
}
['From']
}
,
\code
{
\var
{
m
}
['from']
}
and
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
}
\begin{classdesc}
{
AddressList
}{
field
}
You may instantiate the AddresssList helper class using a single
You may instantiate the AddresssList helper class using a single
string parameter, a comma-separated list of
RFC822
addresses to be
string parameter, a comma-separated list of
\rfc
{
822
}
addresses to be
parsed. (The parameter
None
yields an empty list.)
parsed. (The parameter
\code
{
None
}
yields an empty list.)
\end{classdesc}
\end{classdesc}
\begin{funcdesc}
{
parsedate
}{
date
}
\begin{funcdesc}
{
parsedate
}{
date
}
...
@@ -144,7 +145,7 @@ be returned when there is no header matching \var{name}.
...
@@ -144,7 +145,7 @@ be returned when there is no header matching \var{name}.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
{
get
}{
name
\optional
{
, default
}}
\begin{methoddesc}
{
get
}{
name
\optional
{
, default
}}
An alias for
\
code
{
getheader()
}
, to make the interface more compatible
An alias for
\
method
{
getheader()
}
, to make the interface more compatible
with regular dictionaries.
with regular dictionaries.
\end{methoddesc}
\end{methoddesc}
...
@@ -166,7 +167,7 @@ exact same result.
...
@@ -166,7 +167,7 @@ exact same result.
\begin{methoddesc}
{
getaddrlist
}{
name
}
\begin{methoddesc}
{
getaddrlist
}{
name
}
This is similar to
\code
{
getaddr(
\var
{
list
}
)
}
, but parses a header
This is similar to
\code
{
getaddr(
\var
{
list
}
)
}
, but parses a header
containing a list of email addresses (e.g. a
\code
{
To
}
header) and
containing a list of email addresses (e.g.
\
a
\code
{
To
}
header) and
returns a list of
\code
{
(
\var
{
full name
}
,
\var
{
email address
}
)
}
pairs
returns a list of
\code
{
(
\var
{
full name
}
,
\var
{
email address
}
)
}
pairs
(even if there was only one address in the header). If there is no
(even if there was only one address in the header). If there is no
header matching
\var
{
name
}
, return an empty list.
header matching
\var
{
name
}
, return an empty list.
...
...
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