]> granicus.if.org Git - python/commitdiff
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
authorGuido van Rossum <guido@python.org>
Sun, 27 Apr 1997 21:25:52 +0000 (21:25 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 27 Apr 1997 21:25:52 +0000 (21:25 +0000)
13 files changed:
Doc/Makefile
Doc/lib.tex
Doc/lib/lib.tex
Doc/lib/liballos.tex
Doc/lib/libbase64.tex [new file with mode: 0644]
Doc/lib/libfnmatch.tex [new file with mode: 0644]
Doc/lib/libquopri.tex [new file with mode: 0644]
Doc/lib/libwww.tex
Doc/liballos.tex
Doc/libbase64.tex [new file with mode: 0644]
Doc/libfnmatch.tex [new file with mode: 0644]
Doc/libquopri.tex [new file with mode: 0644]
Doc/libwww.tex

index ebcfa12c74557d7668fa0ad82e745b524fc55735..bf2491c2a8181bb8a4b4626cb3e646a186df8508 100644 (file)
@@ -114,7 +114,8 @@ LIBFILES = lib.tex \
     librestricted.tex librexec.tex libbastion.tex \
     libformatter.tex liboperator.tex libsoundex.tex libresource.tex \
     libstat.tex libstrio.tex libundoc.tex libmailcap.tex libglob.tex \
-    libuser.tex libanydbm.tex librandom.tex libsite.tex libwhichdb.tex
+    libuser.tex libanydbm.tex librandom.tex libsite.tex libwhichdb.tex \
+    libbase64.tex libfnmatch.tex libquopri.tex
 
 # Library document
 lib.dvi: $(LIBFILES)
index fd98bfa3180b9faeb6ab4be85a4e8e153e2ed5dd..f9e23aa9ec69eec272f6b787045ada2f8b0b4134 100644 (file)
@@ -112,6 +112,7 @@ to Python and how to embed it in other applications.
 \input{libtempfile}
 \input{liberrno}
 \input{libglob}
+\input{libfnmatch}
 
 \input{libsomeos}              % Optional Operating System Services
 \input{libsignal}
@@ -156,6 +157,8 @@ to Python and how to embed it in other applications.
 \input{libbinascii}
 \input{libxdrlib}
 \input{libmailcap}
+\input{libbase64}
+\input{libquopri}
 
 \input{librestricted}
 \input{librexec}
index fd98bfa3180b9faeb6ab4be85a4e8e153e2ed5dd..f9e23aa9ec69eec272f6b787045ada2f8b0b4134 100644 (file)
@@ -112,6 +112,7 @@ to Python and how to embed it in other applications.
 \input{libtempfile}
 \input{liberrno}
 \input{libglob}
+\input{libfnmatch}
 
 \input{libsomeos}              % Optional Operating System Services
 \input{libsignal}
@@ -156,6 +157,8 @@ to Python and how to embed it in other applications.
 \input{libbinascii}
 \input{libxdrlib}
 \input{libmailcap}
+\input{libbase64}
+\input{libquopri}
 
 \input{librestricted}
 \input{librexec}
index 5cf7f9492c62a619dac640936223a3a95b71a526..2a536cd778c5fc6648a202801253baa8f22c336c 100644 (file)
@@ -26,4 +26,7 @@ systems as well.  Here's an overview:
 \item[glob]
 --- Unix shell style pathname pattern expansion.
 
+\item[fnmatch]
+--- Unix shell style pathname pattern matching.
+
 \end{description}
diff --git a/Doc/lib/libbase64.tex b/Doc/lib/libbase64.tex
new file mode 100644 (file)
index 0000000..c487576
--- /dev/null
@@ -0,0 +1,43 @@
+\section{Standard Module \sectcode{base64}}
+\stmodindex{base64}
+
+This module perform base-64 encoding and decoding of arbitrary binary
+strings into text strings that can be safely emailed or posted.  The
+encoding scheme is defined in RFC 1421 and is used for MIME email and
+various other Internet-related applications; it is not the same as the
+output produced by the \file{uuencode} program.  For example, the
+string \code{'www.python.org'} is encoded as the string
+\code{'d3d3LnB5dGhvbi5vcmc=\e n'}.  
+\indexii{base-64}{encoding}
+\indexii{RFC}{1421}
+\index{MIME, base 64 encoding}
+
+\begin{funcdesc}{decode}{input\, output}
+Decode the contents of the \var{input} file and write the resulting
+binary data to the \var{output} file.
+\var{input} and \var{output} must either be file objects or objects that
+mimic the file object interface. \var{input} will be read until
+\code{\var{input}.read()} returns an empty string.
+\end{funcdesc}
+
+\begin{funcdesc}{decodestring}{s}
+Decode the string \var{s}, which must contain one or more lines of
+base-64 encoded data, and return a string containing the resulting
+binary data.
+\end{funcdesc}
+
+\begin{funcdesc}{encode}{input\, output}
+Encode the contents of the \var{input} file and write the resulting
+base-64 encoded data to the \var{output} file.
+\var{input} and \var{output} must either be file objects or objects that
+mimic the file object interface. \var{input} will be read until
+\code{\var{input}.read()} returns an empty string.
+\end{funcdesc}
+
+\begin{funcdesc}{encodestring}{s}
+Encode the string \var{s}, which can contain arbitrary binary data,
+and return a string containing one or more lines of
+base-64 encoded data.
+\end{funcdesc}
+
+
diff --git a/Doc/lib/libfnmatch.tex b/Doc/lib/libfnmatch.tex
new file mode 100644 (file)
index 0000000..78b21a4
--- /dev/null
@@ -0,0 +1,38 @@
+\section{Standard Module \sectcode{fnmatch}}
+\stmodindex{fnmatch}
+
+This module provides support for Unix shell-style wildcards, which are
+\emph{not} the same as Python's regular expressions (which are
+documented in the \code{regex} module).  The special characters used
+in shell-style wildcards are:
+\begin{itemize}
+\item[\code{*}] matches everything
+\item[\code{?}]        matches any single character
+\item[\code{[}\var{seq}\code{]}] matches any character in \var{seq}
+\item[\code{[!}\var{seq}\code{]}] matches any character not in \var{seq}
+\end{itemize}
+
+Note that the filename separator (\code{'/'} on Unix) is \emph{not}
+special to this module.  See module \code{glob} for pathname expansion
+(\code{glob} uses \code{fnmatch} to match filename segments).
+
+\begin{funcdesc}{fnmatch}{filename\, pattern}
+Test whether the \var{filename} string matches the \var{pattern}
+string, returning true or false.  If the operating system is
+case-insensitive, then both parameters will be normalized to all
+lower- or upper-case before the comparision is performed.  If you
+require a case-sensitive comparision regardless of whether that's
+standard for your operating system, use \code{fnmatchcase()} instead.
+\end{funcdesc}
+
+\begin{funcdesc}{fnmatchcase}{}
+Test whether \var{filename} matches \var{pattern}, returning true or
+false; the comparision is case-sensitive.
+\end{funcdesc}
+
+\begin{funcdesc}{translate}{pattern}
+Translate a shell pattern into a corresponding regular expression,
+returning a string describing the pattern.  It does not compile the
+expression.  
+\end{funcdesc}
+
diff --git a/Doc/lib/libquopri.tex b/Doc/lib/libquopri.tex
new file mode 100644 (file)
index 0000000..0314f8a
--- /dev/null
@@ -0,0 +1,31 @@
+\section{Standard Module \sectcode{quopri}}
+\stmodindex{quopri}
+
+This module performs quoted-printable transport encoding and decoding,
+as defined in RFC 1521: ``MIME (Multipurpose Internet Mail Extensions)
+Part One''.  The quoted-printable encoding is designed for data where
+there are relatively few nonprintable characters; the base-64 encoding
+scheme available via the \code{base64} module is more compact if there
+are many such characters, as when sending a graphics file.
+\indexii{quoted printable}{encoding}
+\indexii{RFC}{1521}
+\index{MIME!quoted-printable encoding}
+
+\begin{funcdesc}{decode}{input\, output}
+Decode the contents of the \var{input} file and write the resulting
+decoded binary data to the \var{output} file.
+\var{input} and \var{output} must either be file objects or objects that
+mimic the file object interface. \var{input} will be read until
+\code{\var{input}.read()} returns an empty string.
+\end{funcdesc}
+
+\begin{funcdesc}{encode}{input\, output\, quotetabs}
+Encode the contents of the \var{input} file and write the resulting
+quoted-printable data to the \var{output} file.
+\var{input} and \var{output} must either be file objects or objects that
+mimic the file object interface. \var{input} will be read until
+\code{\var{input}.read()} returns an empty string.
+\end{funcdesc}
+
+
+
index aae20b2989375eb31aaebac7013780f5a54c7a4a..93bce637ac70135bd7c78efa84e419ed538599cf 100644 (file)
@@ -68,4 +68,10 @@ written by Sun Microsystems, Inc. June 1987.
 \item[mailcap]
 --- Mailcap file handling.  See RFC 1524.
 
+\item[base64]
+--- Encode/decode binary files using the MIME base64 encoding.
+
+\item[quopri]
+--- Encode/decode binary files using the MIME quoted-printable encoding.
+
 \end{description}
index 5cf7f9492c62a619dac640936223a3a95b71a526..2a536cd778c5fc6648a202801253baa8f22c336c 100644 (file)
@@ -26,4 +26,7 @@ systems as well.  Here's an overview:
 \item[glob]
 --- Unix shell style pathname pattern expansion.
 
+\item[fnmatch]
+--- Unix shell style pathname pattern matching.
+
 \end{description}
diff --git a/Doc/libbase64.tex b/Doc/libbase64.tex
new file mode 100644 (file)
index 0000000..c487576
--- /dev/null
@@ -0,0 +1,43 @@
+\section{Standard Module \sectcode{base64}}
+\stmodindex{base64}
+
+This module perform base-64 encoding and decoding of arbitrary binary
+strings into text strings that can be safely emailed or posted.  The
+encoding scheme is defined in RFC 1421 and is used for MIME email and
+various other Internet-related applications; it is not the same as the
+output produced by the \file{uuencode} program.  For example, the
+string \code{'www.python.org'} is encoded as the string
+\code{'d3d3LnB5dGhvbi5vcmc=\e n'}.  
+\indexii{base-64}{encoding}
+\indexii{RFC}{1421}
+\index{MIME, base 64 encoding}
+
+\begin{funcdesc}{decode}{input\, output}
+Decode the contents of the \var{input} file and write the resulting
+binary data to the \var{output} file.
+\var{input} and \var{output} must either be file objects or objects that
+mimic the file object interface. \var{input} will be read until
+\code{\var{input}.read()} returns an empty string.
+\end{funcdesc}
+
+\begin{funcdesc}{decodestring}{s}
+Decode the string \var{s}, which must contain one or more lines of
+base-64 encoded data, and return a string containing the resulting
+binary data.
+\end{funcdesc}
+
+\begin{funcdesc}{encode}{input\, output}
+Encode the contents of the \var{input} file and write the resulting
+base-64 encoded data to the \var{output} file.
+\var{input} and \var{output} must either be file objects or objects that
+mimic the file object interface. \var{input} will be read until
+\code{\var{input}.read()} returns an empty string.
+\end{funcdesc}
+
+\begin{funcdesc}{encodestring}{s}
+Encode the string \var{s}, which can contain arbitrary binary data,
+and return a string containing one or more lines of
+base-64 encoded data.
+\end{funcdesc}
+
+
diff --git a/Doc/libfnmatch.tex b/Doc/libfnmatch.tex
new file mode 100644 (file)
index 0000000..78b21a4
--- /dev/null
@@ -0,0 +1,38 @@
+\section{Standard Module \sectcode{fnmatch}}
+\stmodindex{fnmatch}
+
+This module provides support for Unix shell-style wildcards, which are
+\emph{not} the same as Python's regular expressions (which are
+documented in the \code{regex} module).  The special characters used
+in shell-style wildcards are:
+\begin{itemize}
+\item[\code{*}] matches everything
+\item[\code{?}]        matches any single character
+\item[\code{[}\var{seq}\code{]}] matches any character in \var{seq}
+\item[\code{[!}\var{seq}\code{]}] matches any character not in \var{seq}
+\end{itemize}
+
+Note that the filename separator (\code{'/'} on Unix) is \emph{not}
+special to this module.  See module \code{glob} for pathname expansion
+(\code{glob} uses \code{fnmatch} to match filename segments).
+
+\begin{funcdesc}{fnmatch}{filename\, pattern}
+Test whether the \var{filename} string matches the \var{pattern}
+string, returning true or false.  If the operating system is
+case-insensitive, then both parameters will be normalized to all
+lower- or upper-case before the comparision is performed.  If you
+require a case-sensitive comparision regardless of whether that's
+standard for your operating system, use \code{fnmatchcase()} instead.
+\end{funcdesc}
+
+\begin{funcdesc}{fnmatchcase}{}
+Test whether \var{filename} matches \var{pattern}, returning true or
+false; the comparision is case-sensitive.
+\end{funcdesc}
+
+\begin{funcdesc}{translate}{pattern}
+Translate a shell pattern into a corresponding regular expression,
+returning a string describing the pattern.  It does not compile the
+expression.  
+\end{funcdesc}
+
diff --git a/Doc/libquopri.tex b/Doc/libquopri.tex
new file mode 100644 (file)
index 0000000..0314f8a
--- /dev/null
@@ -0,0 +1,31 @@
+\section{Standard Module \sectcode{quopri}}
+\stmodindex{quopri}
+
+This module performs quoted-printable transport encoding and decoding,
+as defined in RFC 1521: ``MIME (Multipurpose Internet Mail Extensions)
+Part One''.  The quoted-printable encoding is designed for data where
+there are relatively few nonprintable characters; the base-64 encoding
+scheme available via the \code{base64} module is more compact if there
+are many such characters, as when sending a graphics file.
+\indexii{quoted printable}{encoding}
+\indexii{RFC}{1521}
+\index{MIME!quoted-printable encoding}
+
+\begin{funcdesc}{decode}{input\, output}
+Decode the contents of the \var{input} file and write the resulting
+decoded binary data to the \var{output} file.
+\var{input} and \var{output} must either be file objects or objects that
+mimic the file object interface. \var{input} will be read until
+\code{\var{input}.read()} returns an empty string.
+\end{funcdesc}
+
+\begin{funcdesc}{encode}{input\, output\, quotetabs}
+Encode the contents of the \var{input} file and write the resulting
+quoted-printable data to the \var{output} file.
+\var{input} and \var{output} must either be file objects or objects that
+mimic the file object interface. \var{input} will be read until
+\code{\var{input}.read()} returns an empty string.
+\end{funcdesc}
+
+
+
index aae20b2989375eb31aaebac7013780f5a54c7a4a..93bce637ac70135bd7c78efa84e419ed538599cf 100644 (file)
@@ -68,4 +68,10 @@ written by Sun Microsystems, Inc. June 1987.
 \item[mailcap]
 --- Mailcap file handling.  See RFC 1524.
 
+\item[base64]
+--- Encode/decode binary files using the MIME base64 encoding.
+
+\item[quopri]
+--- Encode/decode binary files using the MIME quoted-printable encoding.
+
 \end{description}