Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d86038d

Browse files
committed
Apply the new \mailheader macro where appropriate, and fix a few small
markup inconsistencies.
1 parent 7eac0cb commit d86038d

5 files changed

Lines changed: 57 additions & 54 deletions

File tree

Doc/lib/libmailbox.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ \section{\module{mailbox} ---
9494
\seetitle[http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/content-length.html]{Configuring
9595
Netscape Mail on \UNIX: Why the Content-Length Format is
9696
Bad}{A description of problems with relying on the
97-
Content-Length header for messages stored in mailbox
98-
files.}
97+
\mailheader{Content-Length} header for messages stored in
98+
mailbox files.}
9999
\end{seealso}
100100

101101

Doc/lib/libmimetools.tex

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ \subsection{Additional Methods of Message Objects
6868
addition to the \class{rfc822.Message} methods:
6969

7070
\begin{methoddesc}{getplist}{}
71-
Return the parameter list of the \code{content-type} header. This is
72-
a list of strings. For parameters of the form
71+
Return the parameter list of the \mailheader{Content-Type} header.
72+
This is a list of strings. For parameters of the form
7373
\samp{\var{key}=\var{value}}, \var{key} is converted to lower case but
7474
\var{value} is not. For example, if the message contains the header
7575
\samp{Content-type: text/html; spam=1; Spam=2; Spam} then
@@ -85,26 +85,27 @@ \subsection{Additional Methods of Message Objects
8585
\end{methoddesc}
8686

8787
\begin{methoddesc}{getencoding}{}
88-
Return the encoding specified in the \code{content-transfer-encoding}
89-
message header. If no such header exists, return \code{'7bit'}. The
90-
encoding is converted to lower case.
88+
Return the encoding specified in the
89+
\mailheader{Content-Transfer-Encoding} message header. If no such
90+
header exists, return \code{'7bit'}. The encoding is converted to
91+
lower case.
9192
\end{methoddesc}
9293

9394
\begin{methoddesc}{gettype}{}
9495
Return the message type (of the form \samp{\var{type}/\var{subtype}})
95-
as specified in the \code{content-type} header. If no such header
96-
exists, return \code{'text/plain'}. The type is converted to lower
97-
case.
96+
as specified in the \mailheader{Content-Type} header. If no such
97+
header exists, return \code{'text/plain'}. The type is converted to
98+
lower case.
9899
\end{methoddesc}
99100

100101
\begin{methoddesc}{getmaintype}{}
101-
Return the main type as specified in the \code{content-type} header.
102-
If no such header exists, return \code{'text'}. The main type is
103-
converted to lower case.
102+
Return the main type as specified in the \mailheader{Content-Type}
103+
header. If no such header exists, return \code{'text'}. The main
104+
type is converted to lower case.
104105
\end{methoddesc}
105106

106107
\begin{methoddesc}{getsubtype}{}
107-
Return the subtype as specified in the \code{content-type} header. If
108-
no such header exists, return \code{'plain'}. The subtype is
109-
converted to lower case.
108+
Return the subtype as specified in the \mailheader{Content-Type}
109+
header. If no such header exists, return \code{'plain'}. The subtype
110+
is converted to lower case.
110111
\end{methoddesc}

Doc/lib/libmimetypes.tex

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ \section{\module{mimetypes} ---
2020

2121
\begin{funcdesc}{guess_type}{filename}
2222
Guess the type of a file based on its filename or URL, given by
23-
\var{filename}.
24-
The return value is a tuple \code{(\var{type}, \var{encoding})} where
25-
\var{type} is \code{None} if the type can't be guessed (no or unknown
26-
suffix) or a string of the form \code{'\var{type}/\var{subtype}'},
27-
usable for a MIME \code{content-type} header\indexii{MIME}{headers}; and
28-
encoding is \code{None} for no encoding or the name of the program used
29-
to encode (e.g. \program{compress} or \program{gzip}). The encoding
30-
is suitable for use as a \code{content-encoding} header,
31-
\emph{not} as a \code{content-transfer-encoding} header. The mappings
32-
are table driven. Encoding suffixes are case sensitive; type suffixes
33-
are first tried case sensitive, then case insensitive.
23+
\var{filename}. The return value is a tuple \code{(\var{type},
24+
\var{encoding})} where \var{type} is \code{None} if the type can't be
25+
guessed (no or unknown suffix) or a string of the form
26+
\code{'\var{type}/\var{subtype}'}, usable for a MIME
27+
\mailheader{content-type} header\indexii{MIME}{headers}; and encoding
28+
is \code{None} for no encoding or the name of the program used to
29+
encode (e.g. \program{compress} or \program{gzip}). The encoding is
30+
suitable for use as a \mailheader{Content-Encoding} header, \emph{not}
31+
as a \mailheader{Content-Transfer-Encoding} header. The mappings are
32+
table driven. Encoding suffixes are case sensitive; type suffixes are
33+
first tried case sensitive, then case insensitive.
3434
\end{funcdesc}
3535

3636
\begin{funcdesc}{guess_extension}{type}
@@ -52,8 +52,8 @@ \section{\module{mimetypes} ---
5252
Initialize the internal data structures. If given, \var{files} must
5353
be a sequence of file names which should be used to augment the
5454
default type map. If omitted, the file names to use are taken from
55-
\code{knownfiles}. Each file named in \var{files} or
56-
\code{knownfiles} takes precedence over those named before it.
55+
\constant{knownfiles}. Each file named in \var{files} or
56+
\constant{knownfiles} takes precedence over those named before it.
5757
Calling \function{init()} repeatedly is allowed.
5858
\end{funcdesc}
5959

Doc/lib/librfc822.tex

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,19 @@ \section{\module{rfc822} ---
7272
\end{funcdesc}
7373

7474
\begin{funcdesc}{parseaddr}{address}
75-
Parse \var{address}, which should be the value of some address-containing
76-
field such as \code{To:} or \code{Cc:}, into its constituent
77-
``realname'' and ``email address'' parts. Returns a tuple of that
78-
information, unless the parse fails, in which case a 2-tuple of
79-
\code{(None, None)} is returned.
75+
Parse \var{address}, which should be the value of some
76+
address-containing field such as \mailheader{To} or \mailheader{Cc},
77+
into its constituent ``realname'' and ``email address'' parts.
78+
Returns a tuple of that information, unless the parse fails, in which
79+
case a 2-tuple \code{(None, None)} is returned.
8080
\end{funcdesc}
8181

8282
\begin{funcdesc}{dump_address_pair}{pair}
8383
The inverse of \method{parseaddr()}, this takes a 2-tuple of the form
84-
\code{(realname, email_address)} and returns the string value suitable
85-
for a \code{To:} or \code{Cc:} header. If the first element of
86-
\var{pair} is false, then the second element is returned unmodified.
84+
\code{(\var{realname}, \var{email_address})} and returns the string
85+
value suitable for a \mailheader{To} or \mailheader{Cc} header. If
86+
the first element of \var{pair} is false, then the second element is
87+
returned unmodified.
8788
\end{funcdesc}
8889

8990
\begin{funcdesc}{parsedate}{date}
@@ -142,9 +143,9 @@ \subsection{Message Objects \label{message-objects}}
142143
\begin{methoddesc}{isheader}{line}
143144
Returns a line's canonicalized fieldname (the dictionary key that will
144145
be used to index it) if the line is a legal \rfc{2822} header; otherwise
145-
returns None (implying that parsing should stop here and the line be
146-
pushed back on the input stream). It is sometimes useful to override
147-
this method in a subclass.
146+
returns \code{None} (implying that parsing should stop here and the
147+
line be pushed back on the input stream). It is sometimes useful to
148+
override this method in a subclass.
148149
\end{methoddesc}
149150

150151
\begin{methoddesc}{islast}{line}
@@ -200,8 +201,8 @@ \subsection{Message Objects \label{message-objects}}
200201
otherwise both the full name and the address are (possibly empty)
201202
strings.
202203

203-
Example: If \var{m}'s first \code{From} header contains the string
204-
\code{'[email protected] (Jack Jansen)'}, then
204+
Example: If \var{m}'s first \mailheader{From} header contains the
205+
string \code{'[email protected] (Jack Jansen)'}, then
205206
\code{m.getaddr('From')} will yield the pair
206207
\code{('Jack Jansen', '[email protected]')}.
207208
If the header contained
@@ -211,14 +212,14 @@ \subsection{Message Objects \label{message-objects}}
211212

212213
\begin{methoddesc}{getaddrlist}{name}
213214
This is similar to \code{getaddr(\var{list})}, but parses a header
214-
containing a list of email addresses (e.g.\ a \code{To} header) and
215+
containing a list of email addresses (e.g.\ a \mailheader{To} header) and
215216
returns a list of \code{(\var{full name}, \var{email address})} pairs
216217
(even if there was only one address in the header). If there is no
217218
header matching \var{name}, return an empty list.
218219

219220
If multiple headers exist that match the named header (e.g. if there
220-
are several \code{Cc} headers), all are parsed for addresses. Any
221-
continuation lines the named headers contain are also parsed.
221+
are several \mailheader{Cc} headers), all are parsed for addresses.
222+
Any continuation lines the named headers contain are also parsed.
222223
\end{methoddesc}
223224

224225
\begin{methoddesc}{getdate}{name}

Doc/lib/liburllib.tex

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ \section{\module{urllib} ---
168168
that an instance of that class to the
169169
\code{urllib._urlopener} variable before calling the desired function.
170170
For example, applications may want to specify a different
171-
\code{user-agent} header than \class{URLopener} defines. This can be
172-
accomplished with the following code:
171+
\mailheader{User-Agent} header than \class{URLopener} defines. This
172+
can be accomplished with the following code:
173173

174174
\begin{verbatim}
175175
class AppURLopener(urllib.FancyURLopener):
@@ -187,9 +187,9 @@ \section{\module{urllib} ---
187187
\class{FancyURLopener}.
188188

189189
By default, the \class{URLopener} class sends a
190-
\code{user-agent} header of \samp{urllib/\var{VVV}}, where
190+
\mailheader{User-Agent} header of \samp{urllib/\var{VVV}}, where
191191
\var{VVV} is the \module{urllib} version number. Applications can
192-
define their own \code{user-agent} header by subclassing
192+
define their own \mailheader{User-Agent} header by subclassing
193193
\class{URLopener} or \class{FancyURLopener} and setting the instance
194194
attribute \member{version} to an appropriate string value before the
195195
\method{open()} method is called.
@@ -203,7 +203,7 @@ \section{\module{urllib} ---
203203
\begin{classdesc}{FancyURLopener}{...}
204204
\class{FancyURLopener} subclasses \class{URLopener} providing default
205205
handling for the following HTTP response codes: 301, 302 or 401. For
206-
301 and 302 response codes, the \code{location} header is used to
206+
301 and 302 response codes, the \mailheader{Location} header is used to
207207
fetch the actual URL. For 401 response codes (authentication
208208
required), basic HTTP authentication is performed. For 301 and 302 response
209209
codes, recursion is bounded by the value of the \var{maxtries} attribute,
@@ -257,10 +257,11 @@ \section{\module{urllib} ---
257257
(e.g. an image), plain text or (for example) HTML\index{HTML}. The
258258
HTTP\indexii{HTTP}{protocol} protocol provides type information in the
259259
reply header, which can be inspected by looking at the
260-
\code{content-type} header. For the Gopher\indexii{Gopher}{protocol}
261-
protocol, type information is encoded in the URL; there is currently
262-
no easy way to extract it. If the returned data is HTML, you can use
263-
the module \refmodule{htmllib}\refstmodindex{htmllib} to parse it.
260+
\mailheader{Content-Type} header. For the
261+
Gopher\indexii{Gopher}{protocol} protocol, type information is encoded
262+
in the URL; there is currently no easy way to extract it. If the
263+
returned data is HTML, you can use the module
264+
\refmodule{htmllib}\refstmodindex{htmllib} to parse it.
264265

265266
\item
266267
This module does not support the use of proxies which require

0 commit comments

Comments
 (0)