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

Skip to content

Commit e76b7a8

Browse files
committed
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
1 parent 8be9a11 commit e76b7a8

13 files changed

Lines changed: 250 additions & 1 deletion

Doc/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ LIBFILES = lib.tex \
114114
librestricted.tex librexec.tex libbastion.tex \
115115
libformatter.tex liboperator.tex libsoundex.tex libresource.tex \
116116
libstat.tex libstrio.tex libundoc.tex libmailcap.tex libglob.tex \
117-
libuser.tex libanydbm.tex librandom.tex libsite.tex libwhichdb.tex
117+
libuser.tex libanydbm.tex librandom.tex libsite.tex libwhichdb.tex \
118+
libbase64.tex libfnmatch.tex libquopri.tex
118119

119120
# Library document
120121
lib.dvi: $(LIBFILES)

Doc/lib.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
\input{libtempfile}
113113
\input{liberrno}
114114
\input{libglob}
115+
\input{libfnmatch}
115116

116117
\input{libsomeos} % Optional Operating System Services
117118
\input{libsignal}
@@ -156,6 +157,8 @@
156157
\input{libbinascii}
157158
\input{libxdrlib}
158159
\input{libmailcap}
160+
\input{libbase64}
161+
\input{libquopri}
159162

160163
\input{librestricted}
161164
\input{librexec}

Doc/lib/lib.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
\input{libtempfile}
113113
\input{liberrno}
114114
\input{libglob}
115+
\input{libfnmatch}
115116

116117
\input{libsomeos} % Optional Operating System Services
117118
\input{libsignal}
@@ -156,6 +157,8 @@
156157
\input{libbinascii}
157158
\input{libxdrlib}
158159
\input{libmailcap}
160+
\input{libbase64}
161+
\input{libquopri}
159162

160163
\input{librestricted}
161164
\input{librexec}

Doc/lib/liballos.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,7 @@ \chapter{Generic Operating System Services}
2626
\item[glob]
2727
--- Unix shell style pathname pattern expansion.
2828

29+
\item[fnmatch]
30+
--- Unix shell style pathname pattern matching.
31+
2932
\end{description}

Doc/lib/libbase64.tex

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
\section{Standard Module \sectcode{base64}}
2+
\stmodindex{base64}
3+
4+
This module perform base-64 encoding and decoding of arbitrary binary
5+
strings into text strings that can be safely emailed or posted. The
6+
encoding scheme is defined in RFC 1421 and is used for MIME email and
7+
various other Internet-related applications; it is not the same as the
8+
output produced by the \file{uuencode} program. For example, the
9+
string \code{'www.python.org'} is encoded as the string
10+
\code{'d3d3LnB5dGhvbi5vcmc=\e n'}.
11+
\indexii{base-64}{encoding}
12+
\indexii{RFC}{1421}
13+
\index{MIME, base 64 encoding}
14+
15+
\begin{funcdesc}{decode}{input\, output}
16+
Decode the contents of the \var{input} file and write the resulting
17+
binary data to the \var{output} file.
18+
\var{input} and \var{output} must either be file objects or objects that
19+
mimic the file object interface. \var{input} will be read until
20+
\code{\var{input}.read()} returns an empty string.
21+
\end{funcdesc}
22+
23+
\begin{funcdesc}{decodestring}{s}
24+
Decode the string \var{s}, which must contain one or more lines of
25+
base-64 encoded data, and return a string containing the resulting
26+
binary data.
27+
\end{funcdesc}
28+
29+
\begin{funcdesc}{encode}{input\, output}
30+
Encode the contents of the \var{input} file and write the resulting
31+
base-64 encoded data to the \var{output} file.
32+
\var{input} and \var{output} must either be file objects or objects that
33+
mimic the file object interface. \var{input} will be read until
34+
\code{\var{input}.read()} returns an empty string.
35+
\end{funcdesc}
36+
37+
\begin{funcdesc}{encodestring}{s}
38+
Encode the string \var{s}, which can contain arbitrary binary data,
39+
and return a string containing one or more lines of
40+
base-64 encoded data.
41+
\end{funcdesc}
42+
43+

Doc/lib/libfnmatch.tex

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
\section{Standard Module \sectcode{fnmatch}}
2+
\stmodindex{fnmatch}
3+
4+
This module provides support for Unix shell-style wildcards, which are
5+
\emph{not} the same as Python's regular expressions (which are
6+
documented in the \code{regex} module). The special characters used
7+
in shell-style wildcards are:
8+
\begin{itemize}
9+
\item[\code{*}] matches everything
10+
\item[\code{?}] matches any single character
11+
\item[\code{[}\var{seq}\code{]}] matches any character in \var{seq}
12+
\item[\code{[!}\var{seq}\code{]}] matches any character not in \var{seq}
13+
\end{itemize}
14+
15+
Note that the filename separator (\code{'/'} on Unix) is \emph{not}
16+
special to this module. See module \code{glob} for pathname expansion
17+
(\code{glob} uses \code{fnmatch} to match filename segments).
18+
19+
\begin{funcdesc}{fnmatch}{filename\, pattern}
20+
Test whether the \var{filename} string matches the \var{pattern}
21+
string, returning true or false. If the operating system is
22+
case-insensitive, then both parameters will be normalized to all
23+
lower- or upper-case before the comparision is performed. If you
24+
require a case-sensitive comparision regardless of whether that's
25+
standard for your operating system, use \code{fnmatchcase()} instead.
26+
\end{funcdesc}
27+
28+
\begin{funcdesc}{fnmatchcase}{}
29+
Test whether \var{filename} matches \var{pattern}, returning true or
30+
false; the comparision is case-sensitive.
31+
\end{funcdesc}
32+
33+
\begin{funcdesc}{translate}{pattern}
34+
Translate a shell pattern into a corresponding regular expression,
35+
returning a string describing the pattern. It does not compile the
36+
expression.
37+
\end{funcdesc}
38+

Doc/lib/libquopri.tex

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
\section{Standard Module \sectcode{quopri}}
2+
\stmodindex{quopri}
3+
4+
This module performs quoted-printable transport encoding and decoding,
5+
as defined in RFC 1521: ``MIME (Multipurpose Internet Mail Extensions)
6+
Part One''. The quoted-printable encoding is designed for data where
7+
there are relatively few nonprintable characters; the base-64 encoding
8+
scheme available via the \code{base64} module is more compact if there
9+
are many such characters, as when sending a graphics file.
10+
\indexii{quoted printable}{encoding}
11+
\indexii{RFC}{1521}
12+
\index{MIME!quoted-printable encoding}
13+
14+
\begin{funcdesc}{decode}{input\, output}
15+
Decode the contents of the \var{input} file and write the resulting
16+
decoded binary data to the \var{output} file.
17+
\var{input} and \var{output} must either be file objects or objects that
18+
mimic the file object interface. \var{input} will be read until
19+
\code{\var{input}.read()} returns an empty string.
20+
\end{funcdesc}
21+
22+
\begin{funcdesc}{encode}{input\, output\, quotetabs}
23+
Encode the contents of the \var{input} file and write the resulting
24+
quoted-printable data to the \var{output} file.
25+
\var{input} and \var{output} must either be file objects or objects that
26+
mimic the file object interface. \var{input} will be read until
27+
\code{\var{input}.read()} returns an empty string.
28+
\end{funcdesc}
29+
30+
31+

Doc/lib/libwww.tex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,10 @@ \chapter{Internet and WWW Services}
6868
\item[mailcap]
6969
--- Mailcap file handling. See RFC 1524.
7070

71+
\item[base64]
72+
--- Encode/decode binary files using the MIME base64 encoding.
73+
74+
\item[quopri]
75+
--- Encode/decode binary files using the MIME quoted-printable encoding.
76+
7177
\end{description}

Doc/liballos.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,7 @@ \chapter{Generic Operating System Services}
2626
\item[glob]
2727
--- Unix shell style pathname pattern expansion.
2828

29+
\item[fnmatch]
30+
--- Unix shell style pathname pattern matching.
31+
2932
\end{description}

Doc/libbase64.tex

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
\section{Standard Module \sectcode{base64}}
2+
\stmodindex{base64}
3+
4+
This module perform base-64 encoding and decoding of arbitrary binary
5+
strings into text strings that can be safely emailed or posted. The
6+
encoding scheme is defined in RFC 1421 and is used for MIME email and
7+
various other Internet-related applications; it is not the same as the
8+
output produced by the \file{uuencode} program. For example, the
9+
string \code{'www.python.org'} is encoded as the string
10+
\code{'d3d3LnB5dGhvbi5vcmc=\e n'}.
11+
\indexii{base-64}{encoding}
12+
\indexii{RFC}{1421}
13+
\index{MIME, base 64 encoding}
14+
15+
\begin{funcdesc}{decode}{input\, output}
16+
Decode the contents of the \var{input} file and write the resulting
17+
binary data to the \var{output} file.
18+
\var{input} and \var{output} must either be file objects or objects that
19+
mimic the file object interface. \var{input} will be read until
20+
\code{\var{input}.read()} returns an empty string.
21+
\end{funcdesc}
22+
23+
\begin{funcdesc}{decodestring}{s}
24+
Decode the string \var{s}, which must contain one or more lines of
25+
base-64 encoded data, and return a string containing the resulting
26+
binary data.
27+
\end{funcdesc}
28+
29+
\begin{funcdesc}{encode}{input\, output}
30+
Encode the contents of the \var{input} file and write the resulting
31+
base-64 encoded data to the \var{output} file.
32+
\var{input} and \var{output} must either be file objects or objects that
33+
mimic the file object interface. \var{input} will be read until
34+
\code{\var{input}.read()} returns an empty string.
35+
\end{funcdesc}
36+
37+
\begin{funcdesc}{encodestring}{s}
38+
Encode the string \var{s}, which can contain arbitrary binary data,
39+
and return a string containing one or more lines of
40+
base-64 encoded data.
41+
\end{funcdesc}
42+
43+

0 commit comments

Comments
 (0)