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

Skip to content

Commit 1189fa9

Browse files
committed
Adjust markup to match current conventions, and make it formattable.
1 parent 768ac6b commit 1189fa9

2 files changed

Lines changed: 50 additions & 41 deletions

File tree

Doc/lib/libnetrc.tex

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
11
% Module and documentation by Eric S. Raymond, 21 Dec 1998
2-
\section{Standard Module \module{netrc}}
3-
\stmodindex{netrc}
4-
\label{module-netrc}
52

6-
The \code{netrc} class parses and encapsulates the netrc file format
7-
used by Unix's ftp(1) and other FTP clientd
3+
\section{\module{netrc} ---
4+
\file{.netrc} processing}
5+
6+
\declaremodule{standard}{netrc}
7+
\moduleauthor{Eric S. Raymond}{[email protected]}
8+
\sectionauthor{Eric S. Raymond}{[email protected]}
9+
10+
11+
The \class{netrc} class parses and encapsulates the netrc file format
12+
used by the \UNIX{} \program{ftp} program and other FTP clients.
813

914
\begin{classdesc}{netrc}{\optional{file}}
1015
A \class{netrc} instance or subclass instance enapsulates data from
11-
a netrc file. The initialization argument, if present, specifies the file
12-
to parse. If no argument is given, the file .netrc in the user's home
13-
directory will be read. Parse errors will throw a SyntaxError
14-
exception with associated diagnostic information including the file
16+
a netrc file. The initialization argument, if present, specifies the
17+
file to parse. If no argument is given, the file \file{.netrc} in the
18+
user's home directory will be read. Parse errors will raise
19+
\exception{SyntaxError} with diagnostic information including the file
1520
name, line number, and terminating token.
1621
\end{classdesc}
1722

18-
\subsection{netrc Objects}
19-
\label{netrc-objects}
23+
\subsection{netrc Objects \label{netrc-objects}}
2024

2125
A \class{netrc} instance has the following methods:
2226

23-
\begin{methoddesc}{authenticators}{}
24-
Return a 3-tuple (login, account, password) of authenticators for the
25-
given host. If the netrc file did not contain an entry for the given
26-
host, return the tuple associated with the `default' entry. If
27-
neither matching host nor default entry is available, return None.
27+
\begin{methoddesc}{authenticators}{host}
28+
Return a 3-tuple \code{(\var{login}, \var{account}, \var{password})}
29+
of authenticators for \var{host}. If the netrc file did not
30+
contain an entry for the given host, return the tuple associated with
31+
the `default' entry. If neither matching host nor default entry is
32+
available, return \code{None}.
2833
\end{methoddesc}
2934

3035
\begin{methoddesc}{__repr__}{host}
@@ -35,13 +40,11 @@ \subsection{netrc Objects}
3540
Instances of \class{netrc} have public instance variables:
3641

3742
\begin{memberdesc}{hosts}
38-
Dictionmary mapping host names to login/account/password tuples. The
39-
`default' entry, if any, is represented as a pseudo-host by that name.
43+
Dictionmary mapping host names to \code{(\var{login}, \var{account},
44+
\var{password})} tuples. The `default' entry, if any, is represented
45+
as a pseudo-host by that name.
4046
\end{memberdesc}
4147

4248
\begin{memberdesc}{macros}
4349
Dictionary mapping macro names to string lists.
4450
\end{memberdesc}
45-
46-
47-

Doc/lib/libshlex.tex

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,36 @@
11
% Module and documentation by Eric S. Raymond, 21 Dec 1998
2-
\section{Standard Module \module{shlex}}
3-
\stmodindex{shlex}
4-
\label{module-shlex}
52

6-
The \code{shlex} class makes it easy to write lexical analyzers for
7-
simple syntaxes resembling that of the Unix shell. This will often
8-
be useful for writing minilanguages, e.g. in run control files for
3+
\section{\module{shlex} ---
4+
Simple lexical analysis}
5+
6+
\declaremodule{standard}{shlex}
7+
\moduleauthor{Eric S. Raymond}{[email protected]}
8+
\sectionauthor{Eric S. Raymond}{[email protected]}
9+
10+
11+
The \class{shlex} class makes it easy to write lexical analyzers for
12+
simple syntaxes resembling that of the \UNIX{} shell. This will often
13+
be useful for writing minilanguages, e.g.\ in run control files for
914
Python applications.
1015

1116
\begin{classdesc}{shlex}{\optional{stream}}
1217
A \class{shlex} instance or subclass instance is a lexical analyzer
1318
object. The initialization argument, if present, specifies where to
1419
read characters from. It must be a file- or stream-like object with
15-
\method{read} and \method{readline} methods. If no argument is given,
16-
input will be taken from sys.stdin.
20+
\method{read()} and \method{readline()} methods. If no argument is given,
21+
input will be taken from \code{sys.stdin}.
1722

1823
\end{classdesc}
1924

20-
\subsection{shlex Objects}
21-
\label{shlex-objects}
25+
\subsection{shlex Objects \label{shlex-objects}}
2226

2327
A \class{shlex} instance has the following methods:
2428

2529
\begin{methoddesc}{get_token}{}
26-
Return a token. If tokens have been stacked using \method{push_token},
27-
pop a token off the stack. Otherwise, read one from the input stream.
28-
If reading encounters an immediate end-of-file, '' is returned.
30+
Return a token. If tokens have been stacked using
31+
\method{push_token()}, pop a token off the stack. Otherwise, read one
32+
from the input stream. If reading encounters an immediate
33+
end-of-file, an empty string is returned.
2934
\end{methoddesc}
3035

3136
\begin{methoddesc}{push_token}{str}
@@ -39,39 +44,40 @@ \subsection{shlex Objects}
3944
\begin{memberdesc}{commenters}
4045
The string of characters that are recognized as comment beginners.
4146
All characters from the comment beginner to end of line are ignored.
42-
Includes just '#' by default.
47+
Includes just \character{\#} by default.
4348
\end{memberdesc}
4449

4550
\begin{memberdesc}{wordchars}
4651
The string of characters that will accumulate into multi-character
47-
tokens. By default, includes all ASCII alphanumerics and underscore.
52+
tokens. By default, includes all \ASCII{} alphanumerics and
53+
underscore.
4854
\end{memberdesc}
4955

5056
\begin{memberdesc}{whitespace}
5157
Characters that will be considered whitespace and skipped. Whitespace
52-
bounds tokens. By default, includes space and tab and linefeed and
58+
bounds tokens. By default, includes space, tab, linefeed and
5359
carriage-return.
5460
\end{memberdesc}
5561

5662
\begin{memberdesc}{quotes}
5763
Characters that will be considered string quotes. The token
5864
accumulates until the same quote is encountered again (thus, different
5965
quote types protect each other as in the shall.) By default, includes
60-
ASCII single and double quotes.
66+
\ASCII{} single and double quotes.
6167
\end{memberdesc}
6268

6369
Note that any character not declared to be a word character,
6470
whitespace, or a quote will be returned as a single-character token.
6571

6672
Quote and comment characters are not recognized within words. Thus,
67-
the bare words ``ain't'' and ``ain#t'' would be returned as single
73+
the bare words \samp{ain't} and \samp{ain\#t} would be returned as single
6874
tokens by the default parser.
6975

7076
\begin{memberdesc}{lineno}
7177
Source line number (count of newlines seen so far plus one).
7278
\end{memberdesc}
7379

7480
\begin{memberdesc}{token}
75-
The token buffer. It may be useful to examine this when catching exceptions.
81+
The token buffer. It may be useful to examine this when catching
82+
exceptions.
7683
\end{memberdesc}
77-

0 commit comments

Comments
 (0)