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

Skip to content

Commit 853276e

Browse files
committed
Lots of markup cleanups to avoid warnings from the GNU info generation;
these make sense even without that processing chain.
1 parent 788617f commit 853276e

3 files changed

Lines changed: 23 additions & 23 deletions

File tree

Doc/lib/liboptparse.tex

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ \subsubsection{Terminology\label{optparse-terminology}}
8282
a chunk of text that a user enters on the command-line, and that the
8383
shell passes to \cfunction{execl()} or \cfunction{execv()}. In
8484
Python, arguments are elements of
85-
\var{sys.argv[1:]}. (\var{sys.argv[0]} is the name of the program
85+
\code{sys.argv[1:]}. (\code{sys.argv[0]} is the name of the program
8686
being executed; in the context of parsing arguments, it's not very
8787
important.) \UNIX{} shells also use the term ``word''.
8888

8989
It is occasionally desirable to use an argument list other than
90-
\var{sys.argv[1:]}, so you should read ``argument'' as ``an element of
91-
\var{sys.argv[1:]}, or of some other list provided as a substitute for
92-
\var{sys.argv[1:]}''.
90+
\code{sys.argv[1:]}, so you should read ``argument'' as ``an element of
91+
\code{sys.argv[1:]}, or of some other list provided as a substitute for
92+
\code{sys.argv[1:]}''.
9393

9494
\term{option}
9595
an argument used to supply extra information to guide or customize
@@ -306,10 +306,10 @@ \subsubsection{The \emph{store} action%
306306
\end{verbatim}
307307

308308
(Note that if you don't pass an argument list to
309-
\function{parse_args()}, it automatically uses \var{sys.argv[1:]}.)
309+
\function{parse_args()}, it automatically uses \code{sys.argv[1:]}.)
310310

311311
When \module{optparse} sees the \programopt{-f}, it consumes the next
312-
argument---\code{foo.txt}---and stores it in the \var{filename}
312+
argument---\code{foo.txt}---and stores it in the \member{filename}
313313
attribute of a special object. That object is the first return value
314314
from \function{parse_args()}, so:
315315

@@ -354,9 +354,9 @@ \subsubsection{The \emph{store} action%
354354
If you don't supply a destination, \module{optparse} figures out a
355355
sensible default from the option strings: if the first long option
356356
string is \longprogramopt{foo-bar}, then the default destination is
357-
\var{foo_bar}. If there are no long option strings,
357+
\member{foo_bar}. If there are no long option strings,
358358
\module{optparse} looks at the first short option: the default
359-
destination for \programopt{-f} is \var{f}.
359+
destination for \programopt{-f} is \member{f}.
360360

361361
Adding types is fairly easy; please refer to
362362
section~\ref{optparse-adding-types}, ``Adding new types.''
@@ -380,8 +380,8 @@ \subsubsection{Other \emph{store_*} actions%
380380
default values---see below.)
381381

382382
When \module{optparse} sees \programopt{-v} on the command line, it sets
383-
\var{options.verbose} to \code{True}; when it sees \programopt{-q}, it
384-
sets \var{options.verbose} to \code{False}.
383+
\code{options.verbose} to \code{True}; when it sees \programopt{-q}, it
384+
sets \code{options.verbose} to \code{False}.
385385

386386
\subsubsection{Setting default values\label{optparse-setting-default-values}}
387387

@@ -394,7 +394,7 @@ \subsubsection{Setting default values\label{optparse-setting-default-values}}
394394
each destination, which is assigned before the command-line is parsed.
395395

396396
First, consider the verbose/quiet example. If we want
397-
\module{optparse} to set \var{verbose} to \code{True} unless
397+
\module{optparse} to set \member{verbose} to \code{True} unless
398398
\programopt{-q} is seen, then we can do this:
399399

400400
\begin{verbatim}
@@ -411,7 +411,7 @@ \subsubsection{Setting default values\label{optparse-setting-default-values}}
411411

412412
Those are equivalent because you're supplying a default value for the
413413
option's \emph{destination}, and these two options happen to have the same
414-
destination (the \var{verbose} variable).
414+
destination (the \member{verbose} variable).
415415

416416
Consider this:
417417

@@ -420,15 +420,15 @@ \subsubsection{Setting default values\label{optparse-setting-default-values}}
420420
parser.add_option("-q", action="store_false", dest="verbose", default=True)
421421
\end{verbatim}
422422

423-
Again, the default value for \var{verbose} will be \code{True}: the last
423+
Again, the default value for \member{verbose} will be \code{True}: the last
424424
default value supplied for any particular destination is the one that
425425
counts.
426426

427427
\subsubsection{Generating help\label{optparse-generating-help}}
428428

429429
The last feature that you will use in every script is
430430
\module{optparse}'s ability to generate help messages. All you have
431-
to do is supply a \var{help} value when you add an option. Let's
431+
to do is supply a \var{help} argument when you add an option. Let's
432432
create a new parser and populate it with user-friendly (documented)
433433
options:
434434

@@ -738,7 +738,7 @@ \subsubsection{Defining options\label{optparse-defining-options}}
738738
\end{verbatim}
739739

740740
one of the first things \module{optparse} does is create a
741-
\var{values} object:
741+
\code{values} object:
742742

743743
\begin{verbatim}
744744
values = Values()
@@ -786,7 +786,7 @@ \subsubsection{Option actions\label{optparse-option-actions}}
786786
\code{nargs > 1}, multiple arguments will be consumed from the command
787787
line; all will be converted according to \var{type} and stored to
788788
\var{dest} as a tuple. See section~\ref{optparse-option-types},
789-
``Option types'' below.
789+
``Option types,'' below.
790790

791791
If \var{choices} (a sequence of strings) is supplied, the type
792792
defaults to ``choice''.
@@ -795,9 +795,9 @@ \subsubsection{Option actions\label{optparse-option-actions}}
795795

796796
If \var{dest} is not supplied, \module{optparse} derives a
797797
destination from the first long option strings (e.g.,
798-
\longprogramopt{foo-bar} becomes \var{foo_bar}). If there are no long
798+
\longprogramopt{foo-bar} becomes \member{foo_bar}). If there are no long
799799
option strings, \module{optparse} derives a destination from the first
800-
short option string (e.g., \programopt{-f} becomes \var{f}).
800+
short option string (e.g., \programopt{-f} becomes \member{f}).
801801

802802
Example:
803803

@@ -1217,7 +1217,7 @@ \subsubsection{How callbacks are called\label{optparse-callbacks-called}}
12171217
\term{opt}
12181218
is the option string seen on the command-line that's triggering the
12191219
callback. (If an abbreviated long option was used, \var{opt} will be
1220-
the full, canonical option string---e.g. if the user puts
1220+
the full, canonical option string---for example, if the user puts
12211221
\longprogramopt{foo} on the command-line as an abbreviation for
12221222
\longprogramopt{foobar}, then \var{opt} will be
12231223
\longprogramopt{foobar}.)
@@ -1676,7 +1676,7 @@ \subsubsection{Other reasons to extend \module{optparse}\label{optparse-extendin
16761676
The second, much more complex, possibility is to override the
16771677
command-line syntax implemented by \module{optparse}. In this case,
16781678
you'd leave the whole machinery of option actions and types alone, but
1679-
rewrite the code that processes \var{sys.argv}. You'll need to
1679+
rewrite the code that processes \code{sys.argv}. You'll need to
16801680
subclass \class{OptionParser} in any case; depending on how radical a
16811681
rewrite you want, you'll probably need to override one or all of
16821682
\method{parse_args()}, \method{_process_long_opt()}, and

Doc/lib/libpdb.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ \section{Debugger Commands \label{debugger-commands}}
265265
is not possible to jump into the middle of a \keyword{for} loop or out
266266
of a \keyword{finally} clause.
267267

268-
\item[l(ist) \optional{\var{first\optional{, last}}}]
268+
\item[l(ist) \optional{\var{first}\optional{, \var{last}}}]
269269

270270
List source code for the current file. Without arguments, list 11
271271
lines around the current line or continue the previous listing. With

Doc/lib/librfc822.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,10 @@ \subsection{Message Objects \label{message-objects}}
255255
In particular: \code{\var{m}[name]} is like
256256
\code{\var{m}.getheader(name)} but raises \exception{KeyError} if
257257
there is no matching header; and \code{len(\var{m})},
258-
\code{\var{m}.get(\var{name}\optional{\var{, default}})},
258+
\code{\var{m}.get(\var{name}\optional{, \var{default}})},
259259
\code{\var{m}.has_key(\var{name})}, \code{\var{m}.keys()},
260260
\code{\var{m}.values()} \code{\var{m}.items()}, and
261-
\code{\var{m}.setdefault(\var{name}\optional{\var{, default}})} act as
261+
\code{\var{m}.setdefault(\var{name}\optional{, \var{default}})} act as
262262
expected, with the one difference that \method{setdefault()} uses
263263
an empty string as the default value. \class{Message} instances
264264
also support the mapping writable interface \code{\var{m}[name] =

0 commit comments

Comments
 (0)