mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Lots of explicit class names for method and member descs.
This commit is contained in:
parent
b8e8df2e63
commit
ae91afdcfb
42 changed files with 489 additions and 489 deletions
|
@ -155,37 +155,37 @@ the \var{raw} parameter is false. This is relevant only for the
|
||||||
|
|
||||||
\class{RawConfigParser} instances have the following methods:
|
\class{RawConfigParser} instances have the following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{defaults}{}
|
\begin{methoddesc}[RawConfigParser]{defaults}{}
|
||||||
Return a dictionary containing the instance-wide defaults.
|
Return a dictionary containing the instance-wide defaults.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{sections}{}
|
\begin{methoddesc}[RawConfigParser]{sections}{}
|
||||||
Return a list of the sections available; \code{DEFAULT} is not
|
Return a list of the sections available; \code{DEFAULT} is not
|
||||||
included in the list.
|
included in the list.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{add_section}{section}
|
\begin{methoddesc}[RawConfigParser]{add_section}{section}
|
||||||
Add a section named \var{section} to the instance. If a section by
|
Add a section named \var{section} to the instance. If a section by
|
||||||
the given name already exists, \exception{DuplicateSectionError} is
|
the given name already exists, \exception{DuplicateSectionError} is
|
||||||
raised.
|
raised.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{has_section}{section}
|
\begin{methoddesc}[RawConfigParser]{has_section}{section}
|
||||||
Indicates whether the named section is present in the
|
Indicates whether the named section is present in the
|
||||||
configuration. The \code{DEFAULT} section is not acknowledged.
|
configuration. The \code{DEFAULT} section is not acknowledged.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{options}{section}
|
\begin{methoddesc}[RawConfigParser]{options}{section}
|
||||||
Returns a list of options available in the specified \var{section}.
|
Returns a list of options available in the specified \var{section}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{has_option}{section, option}
|
\begin{methoddesc}[RawConfigParser]{has_option}{section, option}
|
||||||
If the given section exists, and contains the given option,
|
If the given section exists, and contains the given option,
|
||||||
return \constant{True}; otherwise return \constant{False}.
|
return \constant{True}; otherwise return \constant{False}.
|
||||||
\versionadded{1.6}
|
\versionadded{1.6}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{read}{filenames}
|
\begin{methoddesc}[RawConfigParser]{read}{filenames}
|
||||||
Attempt to read and parse a list of filenames, returning a list of filenames
|
Attempt to read and parse a list of filenames, returning a list of filenames
|
||||||
which were successfully parsed. If \var{filenames} is a string or
|
which were successfully parsed. If \var{filenames} is a string or
|
||||||
Unicode string, it is treated as a single filename.
|
Unicode string, it is treated as a single filename.
|
||||||
|
@ -210,28 +210,28 @@ config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')])
|
||||||
\versionchanged[Returns list of successfully parsed filenames]{2.4}
|
\versionchanged[Returns list of successfully parsed filenames]{2.4}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{readfp}{fp\optional{, filename}}
|
\begin{methoddesc}[RawConfigParser]{readfp}{fp\optional{, filename}}
|
||||||
Read and parse configuration data from the file or file-like object in
|
Read and parse configuration data from the file or file-like object in
|
||||||
\var{fp} (only the \method{readline()} method is used). If
|
\var{fp} (only the \method{readline()} method is used). If
|
||||||
\var{filename} is omitted and \var{fp} has a \member{name} attribute,
|
\var{filename} is omitted and \var{fp} has a \member{name} attribute,
|
||||||
that is used for \var{filename}; the default is \samp{<???>}.
|
that is used for \var{filename}; the default is \samp{<???>}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{get}{section, option}
|
\begin{methoddesc}[RawConfigParser]{get}{section, option}
|
||||||
Get an \var{option} value for the named \var{section}.
|
Get an \var{option} value for the named \var{section}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getint}{section, option}
|
\begin{methoddesc}[RawConfigParser]{getint}{section, option}
|
||||||
A convenience method which coerces the \var{option} in the specified
|
A convenience method which coerces the \var{option} in the specified
|
||||||
\var{section} to an integer.
|
\var{section} to an integer.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getfloat}{section, option}
|
\begin{methoddesc}[RawConfigParser]{getfloat}{section, option}
|
||||||
A convenience method which coerces the \var{option} in the specified
|
A convenience method which coerces the \var{option} in the specified
|
||||||
\var{section} to a floating point number.
|
\var{section} to a floating point number.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getboolean}{section, option}
|
\begin{methoddesc}[RawConfigParser]{getboolean}{section, option}
|
||||||
A convenience method which coerces the \var{option} in the specified
|
A convenience method which coerces the \var{option} in the specified
|
||||||
\var{section} to a Boolean value. Note that the accepted values
|
\var{section} to a Boolean value. Note that the accepted values
|
||||||
for the option are \code{"1"}, \code{"yes"}, \code{"true"}, and \code{"on"},
|
for the option are \code{"1"}, \code{"yes"}, \code{"true"}, and \code{"on"},
|
||||||
|
@ -241,12 +241,12 @@ string values are checked in a case-insensitive manner. Any other value will
|
||||||
cause it to raise \exception{ValueError}.
|
cause it to raise \exception{ValueError}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{items}{section}
|
\begin{methoddesc}[RawConfigParser]{items}{section}
|
||||||
Return a list of \code{(\var{name}, \var{value})} pairs for each
|
Return a list of \code{(\var{name}, \var{value})} pairs for each
|
||||||
option in the given \var{section}.
|
option in the given \var{section}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{set}{section, option, value}
|
\begin{methoddesc}[RawConfigParser]{set}{section, option, value}
|
||||||
If the given section exists, set the given option to the specified
|
If the given section exists, set the given option to the specified
|
||||||
value; otherwise raise \exception{NoSectionError}. While it is
|
value; otherwise raise \exception{NoSectionError}. While it is
|
||||||
possible to use \class{RawConfigParser} (or \class{ConfigParser} with
|
possible to use \class{RawConfigParser} (or \class{ConfigParser} with
|
||||||
|
@ -256,14 +256,14 @@ output to files) can only be achieved using string values.
|
||||||
\versionadded{1.6}
|
\versionadded{1.6}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{write}{fileobject}
|
\begin{methoddesc}[RawConfigParser]{write}{fileobject}
|
||||||
Write a representation of the configuration to the specified file
|
Write a representation of the configuration to the specified file
|
||||||
object. This representation can be parsed by a future \method{read()}
|
object. This representation can be parsed by a future \method{read()}
|
||||||
call.
|
call.
|
||||||
\versionadded{1.6}
|
\versionadded{1.6}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{remove_option}{section, option}
|
\begin{methoddesc}[RawConfigParser]{remove_option}{section, option}
|
||||||
Remove the specified \var{option} from the specified \var{section}.
|
Remove the specified \var{option} from the specified \var{section}.
|
||||||
If the section does not exist, raise \exception{NoSectionError}.
|
If the section does not exist, raise \exception{NoSectionError}.
|
||||||
If the option existed to be removed, return \constant{True};
|
If the option existed to be removed, return \constant{True};
|
||||||
|
@ -271,13 +271,13 @@ otherwise return \constant{False}.
|
||||||
\versionadded{1.6}
|
\versionadded{1.6}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{remove_section}{section}
|
\begin{methoddesc}[RawConfigParser]{remove_section}{section}
|
||||||
Remove the specified \var{section} from the configuration.
|
Remove the specified \var{section} from the configuration.
|
||||||
If the section in fact existed, return \code{True}.
|
If the section in fact existed, return \code{True}.
|
||||||
Otherwise return \code{False}.
|
Otherwise return \code{False}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{optionxform}{option}
|
\begin{methoddesc}[RawConfigParser]{optionxform}{option}
|
||||||
Transforms the option name \var{option} as found in an input file or
|
Transforms the option name \var{option} as found in an input file or
|
||||||
as passed in by client code to the form that should be used in the
|
as passed in by client code to the form that should be used in the
|
||||||
internal structures. The default implementation returns a lower-case
|
internal structures. The default implementation returns a lower-case
|
||||||
|
@ -293,14 +293,14 @@ option names case sensitive.
|
||||||
The \class{ConfigParser} class extends some methods of the
|
The \class{ConfigParser} class extends some methods of the
|
||||||
\class{RawConfigParser} interface, adding some optional arguments.
|
\class{RawConfigParser} interface, adding some optional arguments.
|
||||||
|
|
||||||
\begin{methoddesc}{get}{section, option\optional{, raw\optional{, vars}}}
|
\begin{methoddesc}[ConfigParser]{get}{section, option\optional{, raw\optional{, vars}}}
|
||||||
Get an \var{option} value for the named \var{section}. All the
|
Get an \var{option} value for the named \var{section}. All the
|
||||||
\character{\%} interpolations are expanded in the return values, based
|
\character{\%} interpolations are expanded in the return values, based
|
||||||
on the defaults passed into the constructor, as well as the options
|
on the defaults passed into the constructor, as well as the options
|
||||||
\var{vars} provided, unless the \var{raw} argument is true.
|
\var{vars} provided, unless the \var{raw} argument is true.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{items}{section\optional{, raw\optional{, vars}}}
|
\begin{methoddesc}[ConfigParser]{items}{section\optional{, raw\optional{, vars}}}
|
||||||
Return a list of \code{(\var{name}, \var{value})} pairs for each
|
Return a list of \code{(\var{name}, \var{value})} pairs for each
|
||||||
option in the given \var{section}. Optional arguments have the
|
option in the given \var{section}. Optional arguments have the
|
||||||
same meaning as for the \method{get()} method.
|
same meaning as for the \method{get()} method.
|
||||||
|
@ -313,7 +313,7 @@ same meaning as for the \method{get()} method.
|
||||||
The \class{SafeConfigParser} class implements the same extended
|
The \class{SafeConfigParser} class implements the same extended
|
||||||
interface as \class{ConfigParser}, with the following addition:
|
interface as \class{ConfigParser}, with the following addition:
|
||||||
|
|
||||||
\begin{methoddesc}{set}{section, option, value}
|
\begin{methoddesc}[SafeConfigParser]{set}{section, option, value}
|
||||||
If the given section exists, set the given option to the specified
|
If the given section exists, set the given option to the specified
|
||||||
value; otherwise raise \exception{NoSectionError}. \var{value} must
|
value; otherwise raise \exception{NoSectionError}. \var{value} must
|
||||||
be a string (\class{str} or \class{unicode}); if not,
|
be a string (\class{str} or \class{unicode}); if not,
|
||||||
|
|
|
@ -37,7 +37,7 @@ will default to \var{sys.stdin} and \var{sys.stdout}.
|
||||||
|
|
||||||
A \class{Cmd} instance has the following methods:
|
A \class{Cmd} instance has the following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{cmdloop}{\optional{intro}}
|
\begin{methoddesc}[Cmd]{cmdloop}{\optional{intro}}
|
||||||
Repeatedly issue a prompt, accept input, parse an initial prefix off
|
Repeatedly issue a prompt, accept input, parse an initial prefix off
|
||||||
the received input, and dispatch to action methods, passing them the
|
the received input, and dispatch to action methods, passing them the
|
||||||
remainder of the line as argument.
|
remainder of the line as argument.
|
||||||
|
@ -82,7 +82,7 @@ commands with corresponding \method{help_*()} methods), and also lists
|
||||||
any undocumented commands.
|
any undocumented commands.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{onecmd}{str}
|
\begin{methoddesc}[Cmd]{onecmd}{str}
|
||||||
Interpret the argument as though it had been typed in response to the
|
Interpret the argument as though it had been typed in response to the
|
||||||
prompt. This may be overridden, but should not normally need to be;
|
prompt. This may be overridden, but should not normally need to be;
|
||||||
see the \method{precmd()} and \method{postcmd()} methods for useful
|
see the \method{precmd()} and \method{postcmd()} methods for useful
|
||||||
|
@ -93,25 +93,25 @@ value of that method is returned, otherwise the return value from the
|
||||||
\method{default()} method is returned.
|
\method{default()} method is returned.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{emptyline}{}
|
\begin{methoddesc}[Cmd]{emptyline}{}
|
||||||
Method called when an empty line is entered in response to the prompt.
|
Method called when an empty line is entered in response to the prompt.
|
||||||
If this method is not overridden, it repeats the last nonempty command
|
If this method is not overridden, it repeats the last nonempty command
|
||||||
entered.
|
entered.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{default}{line}
|
\begin{methoddesc}[Cmd]{default}{line}
|
||||||
Method called on an input line when the command prefix is not
|
Method called on an input line when the command prefix is not
|
||||||
recognized. If this method is not overridden, it prints an
|
recognized. If this method is not overridden, it prints an
|
||||||
error message and returns.
|
error message and returns.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{completedefault}{text, line, begidx, endidx}
|
\begin{methoddesc}[Cmd]{completedefault}{text, line, begidx, endidx}
|
||||||
Method called to complete an input line when no command-specific
|
Method called to complete an input line when no command-specific
|
||||||
\method{complete_*()} method is available. By default, it returns an
|
\method{complete_*()} method is available. By default, it returns an
|
||||||
empty list.
|
empty list.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{precmd}{line}
|
\begin{methoddesc}[Cmd]{precmd}{line}
|
||||||
Hook method executed just before the command line \var{line} is
|
Hook method executed just before the command line \var{line} is
|
||||||
interpreted, but after the input prompt is generated and issued. This
|
interpreted, but after the input prompt is generated and issued. This
|
||||||
method is a stub in \class{Cmd}; it exists to be overridden by
|
method is a stub in \class{Cmd}; it exists to be overridden by
|
||||||
|
@ -121,7 +121,7 @@ implementation may re-write the command or simply return \var{line}
|
||||||
unchanged.
|
unchanged.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{postcmd}{stop, line}
|
\begin{methoddesc}[Cmd]{postcmd}{stop, line}
|
||||||
Hook method executed just after a command dispatch is finished. This
|
Hook method executed just after a command dispatch is finished. This
|
||||||
method is a stub in \class{Cmd}; it exists to be overridden by
|
method is a stub in \class{Cmd}; it exists to be overridden by
|
||||||
subclasses. \var{line} is the command line which was executed, and
|
subclasses. \var{line} is the command line which was executed, and
|
||||||
|
@ -133,13 +133,13 @@ corresponds to \var{stop}; returning false will cause interpretation
|
||||||
to continue.
|
to continue.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{preloop}{}
|
\begin{methoddesc}[Cmd]{preloop}{}
|
||||||
Hook method executed once when \method{cmdloop()} is called. This
|
Hook method executed once when \method{cmdloop()} is called. This
|
||||||
method is a stub in \class{Cmd}; it exists to be overridden by
|
method is a stub in \class{Cmd}; it exists to be overridden by
|
||||||
subclasses.
|
subclasses.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{postloop}{}
|
\begin{methoddesc}[Cmd]{postloop}{}
|
||||||
Hook method executed once when \method{cmdloop()} is about to return.
|
Hook method executed once when \method{cmdloop()} is about to return.
|
||||||
This method is a stub in \class{Cmd}; it exists to be overridden by
|
This method is a stub in \class{Cmd}; it exists to be overridden by
|
||||||
subclasses.
|
subclasses.
|
||||||
|
@ -147,47 +147,47 @@ subclasses.
|
||||||
|
|
||||||
Instances of \class{Cmd} subclasses have some public instance variables:
|
Instances of \class{Cmd} subclasses have some public instance variables:
|
||||||
|
|
||||||
\begin{memberdesc}{prompt}
|
\begin{memberdesc}[Cmd]{prompt}
|
||||||
The prompt issued to solicit input.
|
The prompt issued to solicit input.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{identchars}
|
\begin{memberdesc}[Cmd]{identchars}
|
||||||
The string of characters accepted for the command prefix.
|
The string of characters accepted for the command prefix.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{lastcmd}
|
\begin{memberdesc}[Cmd]{lastcmd}
|
||||||
The last nonempty command prefix seen.
|
The last nonempty command prefix seen.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{intro}
|
\begin{memberdesc}[Cmd]{intro}
|
||||||
A string to issue as an intro or banner. May be overridden by giving
|
A string to issue as an intro or banner. May be overridden by giving
|
||||||
the \method{cmdloop()} method an argument.
|
the \method{cmdloop()} method an argument.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{doc_header}
|
\begin{memberdesc}[Cmd]{doc_header}
|
||||||
The header to issue if the help output has a section for documented
|
The header to issue if the help output has a section for documented
|
||||||
commands.
|
commands.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{misc_header}
|
\begin{memberdesc}[Cmd]{misc_header}
|
||||||
The header to issue if the help output has a section for miscellaneous
|
The header to issue if the help output has a section for miscellaneous
|
||||||
help topics (that is, there are \method{help_*()} methods without
|
help topics (that is, there are \method{help_*()} methods without
|
||||||
corresponding \method{do_*()} methods).
|
corresponding \method{do_*()} methods).
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{undoc_header}
|
\begin{memberdesc}[Cmd]{undoc_header}
|
||||||
The header to issue if the help output has a section for undocumented
|
The header to issue if the help output has a section for undocumented
|
||||||
commands (that is, there are \method{do_*()} methods without
|
commands (that is, there are \method{do_*()} methods without
|
||||||
corresponding \method{help_*()} methods).
|
corresponding \method{help_*()} methods).
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{ruler}
|
\begin{memberdesc}[Cmd]{ruler}
|
||||||
The character used to draw separator lines under the help-message
|
The character used to draw separator lines under the help-message
|
||||||
headers. If empty, no ruler line is drawn. It defaults to
|
headers. If empty, no ruler line is drawn. It defaults to
|
||||||
\character{=}.
|
\character{=}.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{use_rawinput}
|
\begin{memberdesc}[Cmd]{use_rawinput}
|
||||||
A flag, defaulting to true. If true, \method{cmdloop()} uses
|
A flag, defaulting to true. If true, \method{cmdloop()} uses
|
||||||
\function{raw_input()} to display a prompt and read the next command;
|
\function{raw_input()} to display a prompt and read the next command;
|
||||||
if false, \method{sys.stdout.write()} and
|
if false, \method{sys.stdout.write()} and
|
||||||
|
|
|
@ -68,7 +68,7 @@ syntax error, or raises \exception{OverflowError} or
|
||||||
\subsection{Interactive Interpreter Objects
|
\subsection{Interactive Interpreter Objects
|
||||||
\label{interpreter-objects}}
|
\label{interpreter-objects}}
|
||||||
|
|
||||||
\begin{methoddesc}{runsource}{source\optional{, filename\optional{, symbol}}}
|
\begin{methoddesc}[InteractiveInterpreter]{runsource}{source\optional{, filename\optional{, symbol}}}
|
||||||
Compile and run some source in the interpreter.
|
Compile and run some source in the interpreter.
|
||||||
Arguments are the same as for \function{compile_command()}; the
|
Arguments are the same as for \function{compile_command()}; the
|
||||||
default for \var{filename} is \code{'<input>'}, and for
|
default for \var{filename} is \code{'<input>'}, and for
|
||||||
|
@ -98,7 +98,7 @@ The return value can be used to decide whether to use
|
||||||
\code{sys.ps1} or \code{sys.ps2} to prompt the next line.
|
\code{sys.ps1} or \code{sys.ps2} to prompt the next line.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{runcode}{code}
|
\begin{methoddesc}[InteractiveInterpreter]{runcode}{code}
|
||||||
Execute a code object.
|
Execute a code object.
|
||||||
When an exception occurs, \method{showtraceback()} is called to
|
When an exception occurs, \method{showtraceback()} is called to
|
||||||
display a traceback. All exceptions are caught except
|
display a traceback. All exceptions are caught except
|
||||||
|
@ -109,7 +109,7 @@ elsewhere in this code, and may not always be caught. The caller
|
||||||
should be prepared to deal with it.
|
should be prepared to deal with it.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{showsyntaxerror}{\optional{filename}}
|
\begin{methoddesc}[InteractiveInterpreter]{showsyntaxerror}{\optional{filename}}
|
||||||
Display the syntax error that just occurred. This does not display
|
Display the syntax error that just occurred. This does not display
|
||||||
a stack trace because there isn't one for syntax errors.
|
a stack trace because there isn't one for syntax errors.
|
||||||
If \var{filename} is given, it is stuffed into the exception instead
|
If \var{filename} is given, it is stuffed into the exception instead
|
||||||
|
@ -118,13 +118,13 @@ always uses \code{'<string>'} when reading from a string.
|
||||||
The output is written by the \method{write()} method.
|
The output is written by the \method{write()} method.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{showtraceback}{}
|
\begin{methoddesc}[InteractiveInterpreter]{showtraceback}{}
|
||||||
Display the exception that just occurred. We remove the first stack
|
Display the exception that just occurred. We remove the first stack
|
||||||
item because it is within the interpreter object implementation.
|
item because it is within the interpreter object implementation.
|
||||||
The output is written by the \method{write()} method.
|
The output is written by the \method{write()} method.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{write}{data}
|
\begin{methoddesc}[InteractiveInterpreter]{write}{data}
|
||||||
Write a string to the standard error stream (\code{sys.stderr}).
|
Write a string to the standard error stream (\code{sys.stderr}).
|
||||||
Derived classes should override this to provide the appropriate output
|
Derived classes should override this to provide the appropriate output
|
||||||
handling as needed.
|
handling as needed.
|
||||||
|
@ -138,7 +138,7 @@ The \class{InteractiveConsole} class is a subclass of
|
||||||
\class{InteractiveInterpreter}, and so offers all the methods of the
|
\class{InteractiveInterpreter}, and so offers all the methods of the
|
||||||
interpreter objects as well as the following additions.
|
interpreter objects as well as the following additions.
|
||||||
|
|
||||||
\begin{methoddesc}{interact}{\optional{banner}}
|
\begin{methoddesc}[InteractiveConsole]{interact}{\optional{banner}}
|
||||||
Closely emulate the interactive Python console.
|
Closely emulate the interactive Python console.
|
||||||
The optional banner argument specify the banner to print before the
|
The optional banner argument specify the banner to print before the
|
||||||
first interaction; by default it prints a banner similar to the one
|
first interaction; by default it prints a banner similar to the one
|
||||||
|
@ -147,7 +147,7 @@ name of the console object in parentheses (so as not to confuse this
|
||||||
with the real interpreter -- since it's so close!).
|
with the real interpreter -- since it's so close!).
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{push}{line}
|
\begin{methoddesc}[InteractiveConsole]{push}{line}
|
||||||
Push a line of source text to the interpreter.
|
Push a line of source text to the interpreter.
|
||||||
The line should not have a trailing newline; it may have internal
|
The line should not have a trailing newline; it may have internal
|
||||||
newlines. The line is appended to a buffer and the interpreter's
|
newlines. The line is appended to a buffer and the interpreter's
|
||||||
|
@ -160,11 +160,11 @@ appended. The return value is \code{True} if more input is required,
|
||||||
\method{runsource()}).
|
\method{runsource()}).
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{resetbuffer}{}
|
\begin{methoddesc}[InteractiveConsole]{resetbuffer}{}
|
||||||
Remove any unhandled source text from the input buffer.
|
Remove any unhandled source text from the input buffer.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{raw_input}{\optional{prompt}}
|
\begin{methoddesc}[InteractiveConsole]{raw_input}{\optional{prompt}}
|
||||||
Write a prompt and read a line. The returned line does not include
|
Write a prompt and read a line. The returned line does not include
|
||||||
the trailing newline. When the user enters the \EOF{} key sequence,
|
the trailing newline. When the user enters the \EOF{} key sequence,
|
||||||
\exception{EOFError} is raised. The base implementation uses the
|
\exception{EOFError} is raised. The base implementation uses the
|
||||||
|
|
|
@ -221,7 +221,7 @@ def maketree(iterable):
|
||||||
|
|
||||||
\subsection{\class{defaultdict} objects \label{defaultdict-objects}}
|
\subsection{\class{defaultdict} objects \label{defaultdict-objects}}
|
||||||
|
|
||||||
\begin{funcdesc}{defaultdict}{\optional{default_factory\optional{, ...}}}
|
\begin{classdesc}{defaultdict}{\optional{default_factory\optional{, ...}}}
|
||||||
Returns a new dictionary-like object. \class{defaultdict} is a subclass
|
Returns a new dictionary-like object. \class{defaultdict} is a subclass
|
||||||
of the builtin \class{dict} class. It overrides one method and adds one
|
of the builtin \class{dict} class. It overrides one method and adds one
|
||||||
writable instance variable. The remaining functionality is the same as
|
writable instance variable. The remaining functionality is the same as
|
||||||
|
@ -233,7 +233,7 @@ def maketree(iterable):
|
||||||
passed to the \class{dict} constructor, including keyword arguments.
|
passed to the \class{dict} constructor, including keyword arguments.
|
||||||
|
|
||||||
\versionadded{2.5}
|
\versionadded{2.5}
|
||||||
\end{funcdesc}
|
\end{classdesc}
|
||||||
|
|
||||||
\class{defaultdict} objects support the following method in addition to
|
\class{defaultdict} objects support the following method in addition to
|
||||||
the standard \class{dict} operations:
|
the standard \class{dict} operations:
|
||||||
|
@ -256,11 +256,11 @@ the standard \class{dict} operations:
|
||||||
|
|
||||||
\class{defaultdict} objects support the following instance variable:
|
\class{defaultdict} objects support the following instance variable:
|
||||||
|
|
||||||
\begin{datadesc}{default_factory}
|
\begin{memberdesc}{default_factory}
|
||||||
This attribute is used by the \method{__missing__} method; it is initialized
|
This attribute is used by the \method{__missing__} method; it is initialized
|
||||||
from the first argument to the constructor, if present, or to \code{None},
|
from the first argument to the constructor, if present, or to \code{None},
|
||||||
if absent.
|
if absent.
|
||||||
\end{datadesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
|
|
||||||
\subsubsection{\class{defaultdict} Examples \label{defaultdict-examples}}
|
\subsubsection{\class{defaultdict} Examples \label{defaultdict-examples}}
|
||||||
|
|
|
@ -292,12 +292,12 @@ If there is a failure, the object's state will not be altered.
|
||||||
|
|
||||||
\class{FileCookieJar} instances have the following public attributes:
|
\class{FileCookieJar} instances have the following public attributes:
|
||||||
|
|
||||||
\begin{memberdesc}{filename}
|
\begin{memberdesc}[FileCookieJar]{filename}
|
||||||
Filename of default file in which to keep cookies. This attribute may
|
Filename of default file in which to keep cookies. This attribute may
|
||||||
be assigned to.
|
be assigned to.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{delayload}
|
\begin{memberdesc}[FileCookieJar]{delayload}
|
||||||
If true, load cookies lazily from disk. This attribute should not be
|
If true, load cookies lazily from disk. This attribute should not be
|
||||||
assigned to. This is only a hint, since this only affects
|
assigned to. This is only a hint, since this only affects
|
||||||
performance, not behaviour (unless the cookies on disk are changing).
|
performance, not behaviour (unless the cookies on disk are changing).
|
||||||
|
@ -400,13 +400,13 @@ In addition to implementing the methods above, implementations of the
|
||||||
attributes, indicating which protocols should be used, and how. All
|
attributes, indicating which protocols should be used, and how. All
|
||||||
of these attributes may be assigned to.
|
of these attributes may be assigned to.
|
||||||
|
|
||||||
\begin{memberdesc}{netscape}
|
\begin{memberdesc}[CookiePolicy]{netscape}
|
||||||
Implement Netscape protocol.
|
Implement Netscape protocol.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
\begin{memberdesc}{rfc2965}
|
\begin{memberdesc}[CookiePolicy]{rfc2965}
|
||||||
Implement RFC 2965 protocol.
|
Implement RFC 2965 protocol.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
\begin{memberdesc}{hide_cookie2}
|
\begin{memberdesc}[CookiePolicy]{hide_cookie2}
|
||||||
Don't add \mailheader{Cookie2} header to requests (the presence of
|
Don't add \mailheader{Cookie2} header to requests (the presence of
|
||||||
this header indicates to the server that we understand RFC 2965
|
this header indicates to the server that we understand RFC 2965
|
||||||
cookies).
|
cookies).
|
||||||
|
@ -504,7 +504,7 @@ receiving cookies.
|
||||||
which are all initialised from the constructor arguments of the same
|
which are all initialised from the constructor arguments of the same
|
||||||
name, and which may all be assigned to.
|
name, and which may all be assigned to.
|
||||||
|
|
||||||
\begin{memberdesc}{rfc2109_as_netscape}
|
\begin{memberdesc}[DefaultCookiePolicy]{rfc2109_as_netscape}
|
||||||
If true, request that the \class{CookieJar} instance downgrade RFC
|
If true, request that the \class{CookieJar} instance downgrade RFC
|
||||||
2109 cookies (ie. cookies received in a \mailheader{Set-Cookie} header
|
2109 cookies (ie. cookies received in a \mailheader{Set-Cookie} header
|
||||||
with a version cookie-attribute of 1) to Netscape cookies by setting
|
with a version cookie-attribute of 1) to Netscape cookies by setting
|
||||||
|
@ -517,7 +517,7 @@ RFC 2109 cookies are downgraded by default.
|
||||||
|
|
||||||
General strictness switches:
|
General strictness switches:
|
||||||
|
|
||||||
\begin{memberdesc}{strict_domain}
|
\begin{memberdesc}[DefaultCookiePolicy]{strict_domain}
|
||||||
Don't allow sites to set two-component domains with country-code
|
Don't allow sites to set two-component domains with country-code
|
||||||
top-level domains like \code{.co.uk}, \code{.gov.uk},
|
top-level domains like \code{.co.uk}, \code{.gov.uk},
|
||||||
\code{.co.nz}.etc. This is far from perfect and isn't guaranteed to
|
\code{.co.nz}.etc. This is far from perfect and isn't guaranteed to
|
||||||
|
@ -526,7 +526,7 @@ work!
|
||||||
|
|
||||||
RFC 2965 protocol strictness switches:
|
RFC 2965 protocol strictness switches:
|
||||||
|
|
||||||
\begin{memberdesc}{strict_rfc2965_unverifiable}
|
\begin{memberdesc}[DefaultCookiePolicy]{strict_rfc2965_unverifiable}
|
||||||
Follow RFC 2965 rules on unverifiable transactions (usually, an
|
Follow RFC 2965 rules on unverifiable transactions (usually, an
|
||||||
unverifiable transaction is one resulting from a redirect or a request
|
unverifiable transaction is one resulting from a redirect or a request
|
||||||
for an image hosted on another site). If this is false, cookies are
|
for an image hosted on another site). If this is false, cookies are
|
||||||
|
@ -535,19 +535,19 @@ for an image hosted on another site). If this is false, cookies are
|
||||||
|
|
||||||
Netscape protocol strictness switches:
|
Netscape protocol strictness switches:
|
||||||
|
|
||||||
\begin{memberdesc}{strict_ns_unverifiable}
|
\begin{memberdesc}[DefaultCookiePolicy]{strict_ns_unverifiable}
|
||||||
apply RFC 2965 rules on unverifiable transactions even to Netscape
|
apply RFC 2965 rules on unverifiable transactions even to Netscape
|
||||||
cookies
|
cookies
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
\begin{memberdesc}{strict_ns_domain}
|
\begin{memberdesc}[DefaultCookiePolicy]{strict_ns_domain}
|
||||||
Flags indicating how strict to be with domain-matching rules for
|
Flags indicating how strict to be with domain-matching rules for
|
||||||
Netscape cookies. See below for acceptable values.
|
Netscape cookies. See below for acceptable values.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
\begin{memberdesc}{strict_ns_set_initial_dollar}
|
\begin{memberdesc}[DefaultCookiePolicy]{strict_ns_set_initial_dollar}
|
||||||
Ignore cookies in Set-Cookie: headers that have names starting with
|
Ignore cookies in Set-Cookie: headers that have names starting with
|
||||||
\code{'\$'}.
|
\code{'\$'}.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
\begin{memberdesc}{strict_ns_set_path}
|
\begin{memberdesc}[DefaultCookiePolicy]{strict_ns_set_path}
|
||||||
Don't allow setting cookies whose path doesn't path-match request URI.
|
Don't allow setting cookies whose path doesn't path-match request URI.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
|
@ -556,30 +556,30 @@ constructed by or-ing together (for example,
|
||||||
\code{DomainStrictNoDots|DomainStrictNonDomain} means both flags are
|
\code{DomainStrictNoDots|DomainStrictNonDomain} means both flags are
|
||||||
set).
|
set).
|
||||||
|
|
||||||
\begin{memberdesc}{DomainStrictNoDots}
|
\begin{memberdesc}[DefaultCookiePolicy]{DomainStrictNoDots}
|
||||||
When setting cookies, the 'host prefix' must not contain a dot
|
When setting cookies, the 'host prefix' must not contain a dot
|
||||||
(eg. \code{www.foo.bar.com} can't set a cookie for \code{.bar.com},
|
(eg. \code{www.foo.bar.com} can't set a cookie for \code{.bar.com},
|
||||||
because \code{www.foo} contains a dot).
|
because \code{www.foo} contains a dot).
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
\begin{memberdesc}{DomainStrictNonDomain}
|
\begin{memberdesc}[DefaultCookiePolicy]{DomainStrictNonDomain}
|
||||||
Cookies that did not explicitly specify a \code{domain}
|
Cookies that did not explicitly specify a \code{domain}
|
||||||
cookie-attribute can only be returned to a domain equal to the domain
|
cookie-attribute can only be returned to a domain equal to the domain
|
||||||
that set the cookie (eg. \code{spam.example.com} won't be returned
|
that set the cookie (eg. \code{spam.example.com} won't be returned
|
||||||
cookies from \code{example.com} that had no \code{domain}
|
cookies from \code{example.com} that had no \code{domain}
|
||||||
cookie-attribute).
|
cookie-attribute).
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
\begin{memberdesc}{DomainRFC2965Match}
|
\begin{memberdesc}[DefaultCookiePolicy]{DomainRFC2965Match}
|
||||||
When setting cookies, require a full RFC 2965 domain-match.
|
When setting cookies, require a full RFC 2965 domain-match.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
The following attributes are provided for convenience, and are the
|
The following attributes are provided for convenience, and are the
|
||||||
most useful combinations of the above flags:
|
most useful combinations of the above flags:
|
||||||
|
|
||||||
\begin{memberdesc}{DomainLiberal}
|
\begin{memberdesc}[DefaultCookiePolicy]{DomainLiberal}
|
||||||
Equivalent to 0 (ie. all of the above Netscape domain strictness flags
|
Equivalent to 0 (ie. all of the above Netscape domain strictness flags
|
||||||
switched off).
|
switched off).
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
\begin{memberdesc}{DomainStrict}
|
\begin{memberdesc}[DefaultCookiePolicy]{DomainStrict}
|
||||||
Equivalent to \code{DomainStrictNoDots|DomainStrictNonDomain}.
|
Equivalent to \code{DomainStrictNoDots|DomainStrictNonDomain}.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
|
|
|
@ -1154,7 +1154,7 @@ following methods. Exactly which methods are needed depends on the
|
||||||
uses made of aware \module{datetime} objects. If in doubt, simply
|
uses made of aware \module{datetime} objects. If in doubt, simply
|
||||||
implement all of them.
|
implement all of them.
|
||||||
|
|
||||||
\begin{methoddesc}{utcoffset}{self, dt}
|
\begin{methoddesc}[tzinfo]{utcoffset}{self, dt}
|
||||||
Return offset of local time from UTC, in minutes east of UTC. If
|
Return offset of local time from UTC, in minutes east of UTC. If
|
||||||
local time is west of UTC, this should be negative. Note that this
|
local time is west of UTC, this should be negative. Note that this
|
||||||
is intended to be the total offset from UTC; for example, if a
|
is intended to be the total offset from UTC; for example, if a
|
||||||
|
@ -1178,7 +1178,7 @@ implement all of them.
|
||||||
\exception{NotImplementedError}.
|
\exception{NotImplementedError}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{dst}{self, dt}
|
\begin{methoddesc}[tzinfo]{dst}{self, dt}
|
||||||
Return the daylight saving time (DST) adjustment, in minutes east of
|
Return the daylight saving time (DST) adjustment, in minutes east of
|
||||||
UTC, or \code{None} if DST information isn't known. Return
|
UTC, or \code{None} if DST information isn't known. Return
|
||||||
\code{timedelta(0)} if DST is not in effect.
|
\code{timedelta(0)} if DST is not in effect.
|
||||||
|
@ -1237,7 +1237,7 @@ implement all of them.
|
||||||
\exception{NotImplementedError}.
|
\exception{NotImplementedError}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{tzname}{self, dt}
|
\begin{methoddesc}[tzinfo]{tzname}{self, dt}
|
||||||
Return the time zone name corresponding to the \class{datetime}
|
Return the time zone name corresponding to the \class{datetime}
|
||||||
object \var{dt}, as a string.
|
object \var{dt}, as a string.
|
||||||
Nothing about string names is defined by the
|
Nothing about string names is defined by the
|
||||||
|
@ -1278,7 +1278,7 @@ and not need worry about objects in other timezones.
|
||||||
There is one more \class{tzinfo} method that a subclass may wish to
|
There is one more \class{tzinfo} method that a subclass may wish to
|
||||||
override:
|
override:
|
||||||
|
|
||||||
\begin{methoddesc}{fromutc}{self, dt}
|
\begin{methoddesc}[tzinfo]{fromutc}{self, dt}
|
||||||
This is called from the default \class{datetime.astimezone()}
|
This is called from the default \class{datetime.astimezone()}
|
||||||
implementation. When called from that, \code{\var{dt}.tzinfo} is
|
implementation. When called from that, \code{\var{dt}.tzinfo} is
|
||||||
\var{self}, and \var{dt}'s date and time members are to be viewed as
|
\var{self}, and \var{dt}'s date and time members are to be viewed as
|
||||||
|
|
|
@ -51,14 +51,14 @@ requests are handled as XML-RPC method calls. HTTP GET requests are
|
||||||
handled by generating pydoc-style HTML documentation. This allows a
|
handled by generating pydoc-style HTML documentation. This allows a
|
||||||
server to provide its own web-based documentation.
|
server to provide its own web-based documentation.
|
||||||
|
|
||||||
\begin{methoddesc}{set_server_title}{server_title}
|
\begin{methoddesc}[DocXMLRPCServer]{set_server_title}{server_title}
|
||||||
|
|
||||||
Set the title used in the generated HTML documentation. This title
|
Set the title used in the generated HTML documentation. This title
|
||||||
will be used inside the HTML "title" element.
|
will be used inside the HTML "title" element.
|
||||||
|
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{set_server_name}{server_name}
|
\begin{methoddesc}[DocXMLRPCServer]{set_server_name}{server_name}
|
||||||
|
|
||||||
Set the name used in the generated HTML documentation. This name will
|
Set the name used in the generated HTML documentation. This name will
|
||||||
appear at the top of the generated documentation inside a "h1"
|
appear at the top of the generated documentation inside a "h1"
|
||||||
|
@ -67,7 +67,7 @@ element.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
|
|
||||||
\begin{methoddesc}{set_server_documentation}{server_documentation}
|
\begin{methoddesc}[DocXMLRPCServer]{set_server_documentation}{server_documentation}
|
||||||
|
|
||||||
Set the description used in the generated HTML documentation. This
|
Set the description used in the generated HTML documentation. This
|
||||||
description will appear as a paragraph, below the server name, in the
|
description will appear as a paragraph, below the server name, in the
|
||||||
|
@ -84,14 +84,14 @@ are handled as XML-RPC method calls. HTTP GET requests are handled by
|
||||||
generating pydoc-style HTML documentation. This allows a server to
|
generating pydoc-style HTML documentation. This allows a server to
|
||||||
provide its own web-based documentation.
|
provide its own web-based documentation.
|
||||||
|
|
||||||
\begin{methoddesc}{set_server_title}{server_title}
|
\begin{methoddesc}[DocCGIXMLRPCRequestHandler]{set_server_title}{server_title}
|
||||||
|
|
||||||
Set the title used in the generated HTML documentation. This title
|
Set the title used in the generated HTML documentation. This title
|
||||||
will be used inside the HTML "title" element.
|
will be used inside the HTML "title" element.
|
||||||
|
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{set_server_name}{server_name}
|
\begin{methoddesc}[DocCGIXMLRPCRequestHandler]{set_server_name}{server_name}
|
||||||
|
|
||||||
Set the name used in the generated HTML documentation. This name will
|
Set the name used in the generated HTML documentation. This name will
|
||||||
appear at the top of the generated documentation inside a "h1"
|
appear at the top of the generated documentation inside a "h1"
|
||||||
|
@ -100,7 +100,7 @@ element.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
|
|
||||||
\begin{methoddesc}{set_server_documentation}{server_documentation}
|
\begin{methoddesc}[DocCGIXMLRPCRequestHandler]{set_server_documentation}{server_documentation}
|
||||||
|
|
||||||
Set the description used in the generated HTML documentation. This
|
Set the description used in the generated HTML documentation. This
|
||||||
description will appear as a paragraph, below the server name, in the
|
description will appear as a paragraph, below the server name, in the
|
||||||
|
|
|
@ -95,7 +95,7 @@ which is used followed by \samp{lines} for the text version or
|
||||||
|
|
||||||
\class{FTP} instances have the following methods:
|
\class{FTP} instances have the following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{set_debuglevel}{level}
|
\begin{methoddesc}[FTP]{set_debuglevel}{level}
|
||||||
Set the instance's debugging level. This controls the amount of
|
Set the instance's debugging level. This controls the amount of
|
||||||
debugging output printed. The default, \code{0}, produces no
|
debugging output printed. The default, \code{0}, produces no
|
||||||
debugging output. A value of \code{1} produces a moderate amount of
|
debugging output. A value of \code{1} produces a moderate amount of
|
||||||
|
@ -104,7 +104,7 @@ debugging output, generally a single line per request. A value of
|
||||||
logging each line sent and received on the control connection.
|
logging each line sent and received on the control connection.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{connect}{host\optional{, port\optional{, timeout}}}
|
\begin{methoddesc}[FTP]{connect}{host\optional{, port\optional{, timeout}}}
|
||||||
Connect to the given host and port. The default port number is \code{21}, as
|
Connect to the given host and port. The default port number is \code{21}, as
|
||||||
specified by the FTP protocol specification. It is rarely needed to
|
specified by the FTP protocol specification. It is rarely needed to
|
||||||
specify a different port number. This function should be called only
|
specify a different port number. This function should be called only
|
||||||
|
@ -119,13 +119,13 @@ class); if the object timeout is also None, the global default timeout
|
||||||
setting will be used.
|
setting will be used.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getwelcome}{}
|
\begin{methoddesc}[FTP]{getwelcome}{}
|
||||||
Return the welcome message sent by the server in reply to the initial
|
Return the welcome message sent by the server in reply to the initial
|
||||||
connection. (This message sometimes contains disclaimers or help
|
connection. (This message sometimes contains disclaimers or help
|
||||||
information that may be relevant to the user.)
|
information that may be relevant to the user.)
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{login}{\optional{user\optional{, passwd\optional{, acct}}}}
|
\begin{methoddesc}[FTP]{login}{\optional{user\optional{, passwd\optional{, acct}}}}
|
||||||
Log in as the given \var{user}. The \var{passwd} and \var{acct}
|
Log in as the given \var{user}. The \var{passwd} and \var{acct}
|
||||||
parameters are optional and default to the empty string. If no
|
parameters are optional and default to the empty string. If no
|
||||||
\var{user} is specified, it defaults to \code{'anonymous'}. If
|
\var{user} is specified, it defaults to \code{'anonymous'}. If
|
||||||
|
@ -137,23 +137,23 @@ instance was created. Most FTP commands are only allowed after the
|
||||||
client has logged in.
|
client has logged in.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{abort}{}
|
\begin{methoddesc}[FTP]{abort}{}
|
||||||
Abort a file transfer that is in progress. Using this does not always
|
Abort a file transfer that is in progress. Using this does not always
|
||||||
work, but it's worth a try.
|
work, but it's worth a try.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{sendcmd}{command}
|
\begin{methoddesc}[FTP]{sendcmd}{command}
|
||||||
Send a simple command string to the server and return the response
|
Send a simple command string to the server and return the response
|
||||||
string.
|
string.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{voidcmd}{command}
|
\begin{methoddesc}[FTP]{voidcmd}{command}
|
||||||
Send a simple command string to the server and handle the response.
|
Send a simple command string to the server and handle the response.
|
||||||
Return nothing if a response code in the range 200--299 is received.
|
Return nothing if a response code in the range 200--299 is received.
|
||||||
Raise an exception otherwise.
|
Raise an exception otherwise.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{retrbinary}{command,
|
\begin{methoddesc}[FTP]{retrbinary}{command,
|
||||||
callback\optional{, maxblocksize\optional{, rest}}}
|
callback\optional{, maxblocksize\optional{, rest}}}
|
||||||
Retrieve a file in binary transfer mode. \var{command} should be an
|
Retrieve a file in binary transfer mode. \var{command} should be an
|
||||||
appropriate \samp{RETR} command: \code{'RETR \var{filename}'}.
|
appropriate \samp{RETR} command: \code{'RETR \var{filename}'}.
|
||||||
|
@ -166,7 +166,7 @@ read on the low-level socket object created to do the actual transfer
|
||||||
same thing as in the \method{transfercmd()} method.
|
same thing as in the \method{transfercmd()} method.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{retrlines}{command\optional{, callback}}
|
\begin{methoddesc}[FTP]{retrlines}{command\optional{, callback}}
|
||||||
Retrieve a file or directory listing in \ASCII{} transfer mode.
|
Retrieve a file or directory listing in \ASCII{} transfer mode.
|
||||||
\var{command} should be an appropriate \samp{RETR} command (see
|
\var{command} should be an appropriate \samp{RETR} command (see
|
||||||
\method{retrbinary()}) or a \samp{LIST} command (usually just the string
|
\method{retrbinary()}) or a \samp{LIST} command (usually just the string
|
||||||
|
@ -175,13 +175,13 @@ with the trailing CRLF stripped. The default \var{callback} prints
|
||||||
the line to \code{sys.stdout}.
|
the line to \code{sys.stdout}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{set_pasv}{boolean}
|
\begin{methoddesc}[FTP]{set_pasv}{boolean}
|
||||||
Enable ``passive'' mode if \var{boolean} is true, other disable
|
Enable ``passive'' mode if \var{boolean} is true, other disable
|
||||||
passive mode. (In Python 2.0 and before, passive mode was off by
|
passive mode. (In Python 2.0 and before, passive mode was off by
|
||||||
default; in Python 2.1 and later, it is on by default.)
|
default; in Python 2.1 and later, it is on by default.)
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{storbinary}{command, file\optional{, blocksize}}
|
\begin{methoddesc}[FTP]{storbinary}{command, file\optional{, blocksize}}
|
||||||
Store a file in binary transfer mode. \var{command} should be an
|
Store a file in binary transfer mode. \var{command} should be an
|
||||||
appropriate \samp{STOR} command: \code{"STOR \var{filename}"}.
|
appropriate \samp{STOR} command: \code{"STOR \var{filename}"}.
|
||||||
\var{file} is an open file object which is read until \EOF{} using its
|
\var{file} is an open file object which is read until \EOF{} using its
|
||||||
|
@ -190,14 +190,14 @@ data to be stored. The \var{blocksize} argument defaults to 8192.
|
||||||
\versionchanged[default for \var{blocksize} added]{2.1}
|
\versionchanged[default for \var{blocksize} added]{2.1}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{storlines}{command, file}
|
\begin{methoddesc}[FTP]{storlines}{command, file}
|
||||||
Store a file in \ASCII{} transfer mode. \var{command} should be an
|
Store a file in \ASCII{} transfer mode. \var{command} should be an
|
||||||
appropriate \samp{STOR} command (see \method{storbinary()}). Lines are
|
appropriate \samp{STOR} command (see \method{storbinary()}). Lines are
|
||||||
read until \EOF{} from the open file object \var{file} using its
|
read until \EOF{} from the open file object \var{file} using its
|
||||||
\method{readline()} method to provide the data to be stored.
|
\method{readline()} method to provide the data to be stored.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{transfercmd}{cmd\optional{, rest}}
|
\begin{methoddesc}[FTP]{transfercmd}{cmd\optional{, rest}}
|
||||||
Initiate a transfer over the data connection. If the transfer is
|
Initiate a transfer over the data connection. If the transfer is
|
||||||
active, send a \samp{EPRT} or \samp{PORT} command and the transfer command specified
|
active, send a \samp{EPRT} or \samp{PORT} command and the transfer command specified
|
||||||
by \var{cmd}, and accept the connection. If the server is passive,
|
by \var{cmd}, and accept the connection. If the server is passive,
|
||||||
|
@ -219,7 +219,7 @@ not recognize the \samp{REST} command, an
|
||||||
simply call \method{transfercmd()} without a \var{rest} argument.
|
simply call \method{transfercmd()} without a \var{rest} argument.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{ntransfercmd}{cmd\optional{, rest}}
|
\begin{methoddesc}[FTP]{ntransfercmd}{cmd\optional{, rest}}
|
||||||
Like \method{transfercmd()}, but returns a tuple of the data
|
Like \method{transfercmd()}, but returns a tuple of the data
|
||||||
connection and the expected size of the data. If the expected size
|
connection and the expected size of the data. If the expected size
|
||||||
could not be computed, \code{None} will be returned as the expected
|
could not be computed, \code{None} will be returned as the expected
|
||||||
|
@ -227,14 +227,14 @@ size. \var{cmd} and \var{rest} means the same thing as in
|
||||||
\method{transfercmd()}.
|
\method{transfercmd()}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{nlst}{argument\optional{, \ldots}}
|
\begin{methoddesc}[FTP]{nlst}{argument\optional{, \ldots}}
|
||||||
Return a list of files as returned by the \samp{NLST} command. The
|
Return a list of files as returned by the \samp{NLST} command. The
|
||||||
optional \var{argument} is a directory to list (default is the current
|
optional \var{argument} is a directory to list (default is the current
|
||||||
server directory). Multiple arguments can be used to pass
|
server directory). Multiple arguments can be used to pass
|
||||||
non-standard options to the \samp{NLST} command.
|
non-standard options to the \samp{NLST} command.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{dir}{argument\optional{, \ldots}}
|
\begin{methoddesc}[FTP]{dir}{argument\optional{, \ldots}}
|
||||||
Produce a directory listing as returned by the \samp{LIST} command,
|
Produce a directory listing as returned by the \samp{LIST} command,
|
||||||
printing it to standard output. The optional \var{argument} is a
|
printing it to standard output. The optional \var{argument} is a
|
||||||
directory to list (default is the current server directory). Multiple
|
directory to list (default is the current server directory). Multiple
|
||||||
|
@ -244,41 +244,41 @@ command. If the last argument is a function, it is used as a
|
||||||
prints to \code{sys.stdout}. This method returns \code{None}.
|
prints to \code{sys.stdout}. This method returns \code{None}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{rename}{fromname, toname}
|
\begin{methoddesc}[FTP]{rename}{fromname, toname}
|
||||||
Rename file \var{fromname} on the server to \var{toname}.
|
Rename file \var{fromname} on the server to \var{toname}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{delete}{filename}
|
\begin{methoddesc}[FTP]{delete}{filename}
|
||||||
Remove the file named \var{filename} from the server. If successful,
|
Remove the file named \var{filename} from the server. If successful,
|
||||||
returns the text of the response, otherwise raises
|
returns the text of the response, otherwise raises
|
||||||
\exception{error_perm} on permission errors or
|
\exception{error_perm} on permission errors or
|
||||||
\exception{error_reply} on other errors.
|
\exception{error_reply} on other errors.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{cwd}{pathname}
|
\begin{methoddesc}[FTP]{cwd}{pathname}
|
||||||
Set the current directory on the server.
|
Set the current directory on the server.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{mkd}{pathname}
|
\begin{methoddesc}[FTP]{mkd}{pathname}
|
||||||
Create a new directory on the server.
|
Create a new directory on the server.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{pwd}{}
|
\begin{methoddesc}[FTP]{pwd}{}
|
||||||
Return the pathname of the current directory on the server.
|
Return the pathname of the current directory on the server.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{rmd}{dirname}
|
\begin{methoddesc}[FTP]{rmd}{dirname}
|
||||||
Remove the directory named \var{dirname} on the server.
|
Remove the directory named \var{dirname} on the server.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{size}{filename}
|
\begin{methoddesc}[FTP]{size}{filename}
|
||||||
Request the size of the file named \var{filename} on the server. On
|
Request the size of the file named \var{filename} on the server. On
|
||||||
success, the size of the file is returned as an integer, otherwise
|
success, the size of the file is returned as an integer, otherwise
|
||||||
\code{None} is returned. Note that the \samp{SIZE} command is not
|
\code{None} is returned. Note that the \samp{SIZE} command is not
|
||||||
standardized, but is supported by many common server implementations.
|
standardized, but is supported by many common server implementations.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{quit}{}
|
\begin{methoddesc}[FTP]{quit}{}
|
||||||
Send a \samp{QUIT} command to the server and close the connection.
|
Send a \samp{QUIT} command to the server and close the connection.
|
||||||
This is the ``polite'' way to close a connection, but it may raise an
|
This is the ``polite'' way to close a connection, but it may raise an
|
||||||
exception of the server reponds with an error to the
|
exception of the server reponds with an error to the
|
||||||
|
@ -287,7 +287,7 @@ method which renders the \class{FTP} instance useless for subsequent
|
||||||
calls (see below).
|
calls (see below).
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{close}{}
|
\begin{methoddesc}[FTP]{close}{}
|
||||||
Close the connection unilaterally. This should not be applied to an
|
Close the connection unilaterally. This should not be applied to an
|
||||||
already closed connection such as after a successful call to
|
already closed connection such as after a successful call to
|
||||||
\method{quit()}. After this call the \class{FTP} instance should not
|
\method{quit()}. After this call the \class{FTP} instance should not
|
||||||
|
|
|
@ -1166,7 +1166,7 @@ class C(B):
|
||||||
as detailed below.
|
as detailed below.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{type}{name, bases, dict}
|
\begin{funcdescni}{type}{name, bases, dict}
|
||||||
Return a new type object. This is essentially a dynamic form of the
|
Return a new type object. This is essentially a dynamic form of the
|
||||||
\keyword{class} statement. The \var{name} string is the class name
|
\keyword{class} statement. The \var{name} string is the class name
|
||||||
and becomes the \member{__name__} attribute; the \var{bases} tuple
|
and becomes the \member{__name__} attribute; the \var{bases} tuple
|
||||||
|
@ -1183,7 +1183,7 @@ class C(B):
|
||||||
>>> X = type('X', (object,), dict(a=1))
|
>>> X = type('X', (object,), dict(a=1))
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
\versionadded{2.2}
|
\versionadded{2.2}
|
||||||
\end{funcdesc}
|
\end{funcdescni}
|
||||||
|
|
||||||
\begin{funcdesc}{unichr}{i}
|
\begin{funcdesc}{unichr}{i}
|
||||||
Return the Unicode string of one character whose Unicode code is the
|
Return the Unicode string of one character whose Unicode code is the
|
||||||
|
|
|
@ -48,25 +48,25 @@ information).
|
||||||
|
|
||||||
Profile objects have the following methods:
|
Profile objects have the following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{addinfo}{key, value}
|
\begin{methoddesc}[Profile]{addinfo}{key, value}
|
||||||
Add an arbitrary labelled value to the profile output.
|
Add an arbitrary labelled value to the profile output.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{close}{}
|
\begin{methoddesc}[Profile]{close}{}
|
||||||
Close the logfile and terminate the profiler.
|
Close the logfile and terminate the profiler.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{fileno}{}
|
\begin{methoddesc}[Profile]{fileno}{}
|
||||||
Return the file descriptor of the profiler's log file.
|
Return the file descriptor of the profiler's log file.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{run}{cmd}
|
\begin{methoddesc}[Profile]{run}{cmd}
|
||||||
Profile an \keyword{exec}-compatible string in the script environment.
|
Profile an \keyword{exec}-compatible string in the script environment.
|
||||||
The globals from the \refmodule[main]{__main__} module are used as
|
The globals from the \refmodule[main]{__main__} module are used as
|
||||||
both the globals and locals for the script.
|
both the globals and locals for the script.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{runcall}{func, *args, **keywords}
|
\begin{methoddesc}[Profile]{runcall}{func, *args, **keywords}
|
||||||
Profile a single call of a callable.
|
Profile a single call of a callable.
|
||||||
Additional positional and keyword arguments may be passed
|
Additional positional and keyword arguments may be passed
|
||||||
along; the result of the call is returned, and exceptions are
|
along; the result of the call is returned, and exceptions are
|
||||||
|
@ -75,16 +75,16 @@ disabled on the way out.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
|
|
||||||
\begin{methoddesc}{runctx}{cmd, globals, locals}
|
\begin{methoddesc}[Profile]{runctx}{cmd, globals, locals}
|
||||||
Evaluate an \keyword{exec}-compatible string in a specific environment.
|
Evaluate an \keyword{exec}-compatible string in a specific environment.
|
||||||
The string is compiled before profiling begins.
|
The string is compiled before profiling begins.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{start}{}
|
\begin{methoddesc}[Profile]{start}{}
|
||||||
Start the profiler.
|
Start the profiler.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{stop}{}
|
\begin{methoddesc}[Profile]{stop}{}
|
||||||
Stop the profiler.
|
Stop the profiler.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
|
|
|
@ -96,11 +96,11 @@ error while parsing.
|
||||||
In addition to tag methods, the \class{HTMLParser} class provides some
|
In addition to tag methods, the \class{HTMLParser} class provides some
|
||||||
additional methods and instance variables for use within tag methods.
|
additional methods and instance variables for use within tag methods.
|
||||||
|
|
||||||
\begin{memberdesc}{formatter}
|
\begin{memberdesc}[HTMLParser]{formatter}
|
||||||
This is the formatter instance associated with the parser.
|
This is the formatter instance associated with the parser.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{nofill}
|
\begin{memberdesc}[HTMLParser]{nofill}
|
||||||
Boolean flag which should be true when whitespace should not be
|
Boolean flag which should be true when whitespace should not be
|
||||||
collapsed, or false when it should be. In general, this should only
|
collapsed, or false when it should be. In general, this should only
|
||||||
be true when character data is to be treated as ``preformatted'' text,
|
be true when character data is to be treated as ``preformatted'' text,
|
||||||
|
@ -109,7 +109,7 @@ affects the operation of \method{handle_data()} and \method{save_end()}.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
|
|
||||||
\begin{methoddesc}{anchor_bgn}{href, name, type}
|
\begin{methoddesc}[HTMLParser]{anchor_bgn}{href, name, type}
|
||||||
This method is called at the start of an anchor region. The arguments
|
This method is called at the start of an anchor region. The arguments
|
||||||
correspond to the attributes of the \code{<A>} tag with the same
|
correspond to the attributes of the \code{<A>} tag with the same
|
||||||
names. The default implementation maintains a list of hyperlinks
|
names. The default implementation maintains a list of hyperlinks
|
||||||
|
@ -118,27 +118,27 @@ document. The list of hyperlinks is available as the data attribute
|
||||||
\member{anchorlist}.
|
\member{anchorlist}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{anchor_end}{}
|
\begin{methoddesc}[HTMLParser]{anchor_end}{}
|
||||||
This method is called at the end of an anchor region. The default
|
This method is called at the end of an anchor region. The default
|
||||||
implementation adds a textual footnote marker using an index into the
|
implementation adds a textual footnote marker using an index into the
|
||||||
list of hyperlinks created by \method{anchor_bgn()}.
|
list of hyperlinks created by \method{anchor_bgn()}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{handle_image}{source, alt\optional{, ismap\optional{,
|
\begin{methoddesc}[HTMLParser]{handle_image}{source, alt\optional{, ismap\optional{,
|
||||||
align\optional{, width\optional{, height}}}}}
|
align\optional{, width\optional{, height}}}}}
|
||||||
This method is called to handle images. The default implementation
|
This method is called to handle images. The default implementation
|
||||||
simply passes the \var{alt} value to the \method{handle_data()}
|
simply passes the \var{alt} value to the \method{handle_data()}
|
||||||
method.
|
method.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{save_bgn}{}
|
\begin{methoddesc}[HTMLParser]{save_bgn}{}
|
||||||
Begins saving character data in a buffer instead of sending it to the
|
Begins saving character data in a buffer instead of sending it to the
|
||||||
formatter object. Retrieve the stored data via \method{save_end()}.
|
formatter object. Retrieve the stored data via \method{save_end()}.
|
||||||
Use of the \method{save_bgn()} / \method{save_end()} pair may not be
|
Use of the \method{save_bgn()} / \method{save_end()} pair may not be
|
||||||
nested.
|
nested.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{save_end}{}
|
\begin{methoddesc}[HTMLParser]{save_end}{}
|
||||||
Ends buffering character data and returns all data saved since the
|
Ends buffering character data and returns all data saved since the
|
||||||
preceding call to \method{save_bgn()}. If the \member{nofill} flag is
|
preceding call to \method{save_bgn()}. If the \member{nofill} flag is
|
||||||
false, whitespace is collapsed to single spaces. A call to this
|
false, whitespace is collapsed to single spaces. A call to this
|
||||||
|
|
|
@ -309,7 +309,7 @@ Example: \code{httplib.responses[httplib.NOT_FOUND]} is \code{'Not Found'}.
|
||||||
|
|
||||||
\class{HTTPConnection} instances have the following methods:
|
\class{HTTPConnection} instances have the following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{request}{method, url\optional{, body\optional{, headers}}}
|
\begin{methoddesc}[HTTPConnection]{request}{method, url\optional{, body\optional{, headers}}}
|
||||||
This will send a request to the server using the HTTP request method
|
This will send a request to the server using the HTTP request method
|
||||||
\var{method} and the selector \var{url}. If the \var{body} argument is
|
\var{method} and the selector \var{url}. If the \var{body} argument is
|
||||||
present, it should be a string of data to send after the headers are finished.
|
present, it should be a string of data to send after the headers are finished.
|
||||||
|
@ -323,24 +323,24 @@ with the request.
|
||||||
\versionchanged[\var{body} can be a file object]{2.6}
|
\versionchanged[\var{body} can be a file object]{2.6}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getresponse}{}
|
\begin{methoddesc}[HTTPConnection]{getresponse}{}
|
||||||
Should be called after a request is sent to get the response from the server.
|
Should be called after a request is sent to get the response from the server.
|
||||||
Returns an \class{HTTPResponse} instance.
|
Returns an \class{HTTPResponse} instance.
|
||||||
\note{Note that you must have read the whole response before you can send a new
|
\note{Note that you must have read the whole response before you can send a new
|
||||||
request to the server.}
|
request to the server.}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{set_debuglevel}{level}
|
\begin{methoddesc}[HTTPConnection]{set_debuglevel}{level}
|
||||||
Set the debugging level (the amount of debugging output printed).
|
Set the debugging level (the amount of debugging output printed).
|
||||||
The default debug level is \code{0}, meaning no debugging output is
|
The default debug level is \code{0}, meaning no debugging output is
|
||||||
printed.
|
printed.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{connect}{}
|
\begin{methoddesc}[HTTPConnection]{connect}{}
|
||||||
Connect to the server specified when the object was created.
|
Connect to the server specified when the object was created.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{close}{}
|
\begin{methoddesc}[HTTPConnection]{close}{}
|
||||||
Close the connection to the server.
|
Close the connection to the server.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
|
@ -348,7 +348,7 @@ As an alternative to using the \method{request()} method described above,
|
||||||
you can also send your request step by step, by using the four functions
|
you can also send your request step by step, by using the four functions
|
||||||
below.
|
below.
|
||||||
|
|
||||||
\begin{methoddesc}{putrequest}{request, selector\optional{,
|
\begin{methoddesc}[HTTPConnection]{putrequest}{request, selector\optional{,
|
||||||
skip\_host\optional{, skip_accept_encoding}}}
|
skip\_host\optional{, skip_accept_encoding}}}
|
||||||
This should be the first call after the connection to the server has
|
This should be the first call after the connection to the server has
|
||||||
been made. It sends a line to the server consisting of the
|
been made. It sends a line to the server consisting of the
|
||||||
|
@ -360,18 +360,18 @@ with non-False values.
|
||||||
\versionchanged[\var{skip_accept_encoding} argument added]{2.4}
|
\versionchanged[\var{skip_accept_encoding} argument added]{2.4}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{putheader}{header, argument\optional{, ...}}
|
\begin{methoddesc}[HTTPConnection]{putheader}{header, argument\optional{, ...}}
|
||||||
Send an \rfc{822}-style header to the server. It sends a line to the
|
Send an \rfc{822}-style header to the server. It sends a line to the
|
||||||
server consisting of the header, a colon and a space, and the first
|
server consisting of the header, a colon and a space, and the first
|
||||||
argument. If more arguments are given, continuation lines are sent,
|
argument. If more arguments are given, continuation lines are sent,
|
||||||
each consisting of a tab and an argument.
|
each consisting of a tab and an argument.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{endheaders}{}
|
\begin{methoddesc}[HTTPConnection]{endheaders}{}
|
||||||
Send a blank line to the server, signalling the end of the headers.
|
Send a blank line to the server, signalling the end of the headers.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{send}{data}
|
\begin{methoddesc}[HTTPConnection]{send}{data}
|
||||||
Send data to the server. This should be used directly only after the
|
Send data to the server. This should be used directly only after the
|
||||||
\method{endheaders()} method has been called and before
|
\method{endheaders()} method has been called and before
|
||||||
\method{getresponse()} is called.
|
\method{getresponse()} is called.
|
||||||
|
@ -381,34 +381,34 @@ Send data to the server. This should be used directly only after the
|
||||||
|
|
||||||
\class{HTTPResponse} instances have the following methods and attributes:
|
\class{HTTPResponse} instances have the following methods and attributes:
|
||||||
|
|
||||||
\begin{methoddesc}{read}{\optional{amt}}
|
\begin{methoddesc}[HTTPResponse]{read}{\optional{amt}}
|
||||||
Reads and returns the response body, or up to the next \var{amt} bytes.
|
Reads and returns the response body, or up to the next \var{amt} bytes.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getheader}{name\optional{, default}}
|
\begin{methoddesc}[HTTPResponse]{getheader}{name\optional{, default}}
|
||||||
Get the contents of the header \var{name}, or \var{default} if there is no
|
Get the contents of the header \var{name}, or \var{default} if there is no
|
||||||
matching header.
|
matching header.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getheaders}{}
|
\begin{methoddesc}[HTTPResponse]{getheaders}{}
|
||||||
Return a list of (header, value) tuples. \versionadded{2.4}
|
Return a list of (header, value) tuples. \versionadded{2.4}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{datadesc}{msg}
|
\begin{memberdesc}[HTTPResponse]{msg}
|
||||||
A \class{mimetools.Message} instance containing the response headers.
|
A \class{mimetools.Message} instance containing the response headers.
|
||||||
\end{datadesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{datadesc}{version}
|
\begin{memberdesc}[HTTPResponse]{version}
|
||||||
HTTP protocol version used by server. 10 for HTTP/1.0, 11 for HTTP/1.1.
|
HTTP protocol version used by server. 10 for HTTP/1.0, 11 for HTTP/1.1.
|
||||||
\end{datadesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{datadesc}{status}
|
\begin{memberdesc}[HTTPResponse]{status}
|
||||||
Status code returned by server.
|
Status code returned by server.
|
||||||
\end{datadesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{datadesc}{reason}
|
\begin{memberdesc}[HTTPResponse]{reason}
|
||||||
Reason phrase returned by server.
|
Reason phrase returned by server.
|
||||||
\end{datadesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
|
|
||||||
\subsection{Examples \label{httplib-examples}}
|
\subsection{Examples \label{httplib-examples}}
|
||||||
|
|
|
@ -153,11 +153,11 @@ can contain an asterisk to indicate an infinite upper bound
|
||||||
An \class{IMAP4} instance has the following methods:
|
An \class{IMAP4} instance has the following methods:
|
||||||
|
|
||||||
|
|
||||||
\begin{methoddesc}{append}{mailbox, flags, date_time, message}
|
\begin{methoddesc}[IMAP4]{append}{mailbox, flags, date_time, message}
|
||||||
Append \var{message} to named mailbox.
|
Append \var{message} to named mailbox.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{authenticate}{mechanism, authobject}
|
\begin{methoddesc}[IMAP4]{authenticate}{mechanism, authobject}
|
||||||
Authenticate command --- requires response processing.
|
Authenticate command --- requires response processing.
|
||||||
|
|
||||||
\var{mechanism} specifies which authentication mechanism is to be
|
\var{mechanism} specifies which authentication mechanism is to be
|
||||||
|
@ -176,115 +176,115 @@ data = authobject(response)
|
||||||
be sent instead.
|
be sent instead.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{check}{}
|
\begin{methoddesc}[IMAP4]{check}{}
|
||||||
Checkpoint mailbox on server.
|
Checkpoint mailbox on server.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{close}{}
|
\begin{methoddesc}[IMAP4]{close}{}
|
||||||
Close currently selected mailbox. Deleted messages are removed from
|
Close currently selected mailbox. Deleted messages are removed from
|
||||||
writable mailbox. This is the recommended command before
|
writable mailbox. This is the recommended command before
|
||||||
\samp{LOGOUT}.
|
\samp{LOGOUT}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{copy}{message_set, new_mailbox}
|
\begin{methoddesc}[IMAP4]{copy}{message_set, new_mailbox}
|
||||||
Copy \var{message_set} messages onto end of \var{new_mailbox}.
|
Copy \var{message_set} messages onto end of \var{new_mailbox}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{create}{mailbox}
|
\begin{methoddesc}[IMAP4]{create}{mailbox}
|
||||||
Create new mailbox named \var{mailbox}.
|
Create new mailbox named \var{mailbox}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{delete}{mailbox}
|
\begin{methoddesc}[IMAP4]{delete}{mailbox}
|
||||||
Delete old mailbox named \var{mailbox}.
|
Delete old mailbox named \var{mailbox}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{deleteacl}{mailbox, who}
|
\begin{methoddesc}[IMAP4]{deleteacl}{mailbox, who}
|
||||||
Delete the ACLs (remove any rights) set for who on mailbox.
|
Delete the ACLs (remove any rights) set for who on mailbox.
|
||||||
\versionadded{2.4}
|
\versionadded{2.4}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{expunge}{}
|
\begin{methoddesc}[IMAP4]{expunge}{}
|
||||||
Permanently remove deleted items from selected mailbox. Generates an
|
Permanently remove deleted items from selected mailbox. Generates an
|
||||||
\samp{EXPUNGE} response for each deleted message. Returned data
|
\samp{EXPUNGE} response for each deleted message. Returned data
|
||||||
contains a list of \samp{EXPUNGE} message numbers in order
|
contains a list of \samp{EXPUNGE} message numbers in order
|
||||||
received.
|
received.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{fetch}{message_set, message_parts}
|
\begin{methoddesc}[IMAP4]{fetch}{message_set, message_parts}
|
||||||
Fetch (parts of) messages. \var{message_parts} should be
|
Fetch (parts of) messages. \var{message_parts} should be
|
||||||
a string of message part names enclosed within parentheses,
|
a string of message part names enclosed within parentheses,
|
||||||
eg: \samp{"(UID BODY[TEXT])"}. Returned data are tuples
|
eg: \samp{"(UID BODY[TEXT])"}. Returned data are tuples
|
||||||
of message part envelope and data.
|
of message part envelope and data.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getacl}{mailbox}
|
\begin{methoddesc}[IMAP4]{getacl}{mailbox}
|
||||||
Get the \samp{ACL}s for \var{mailbox}.
|
Get the \samp{ACL}s for \var{mailbox}.
|
||||||
The method is non-standard, but is supported by the \samp{Cyrus} server.
|
The method is non-standard, but is supported by the \samp{Cyrus} server.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getannotation}{mailbox, entry, attribute}
|
\begin{methoddesc}[IMAP4]{getannotation}{mailbox, entry, attribute}
|
||||||
Retrieve the specified \samp{ANNOTATION}s for \var{mailbox}.
|
Retrieve the specified \samp{ANNOTATION}s for \var{mailbox}.
|
||||||
The method is non-standard, but is supported by the \samp{Cyrus} server.
|
The method is non-standard, but is supported by the \samp{Cyrus} server.
|
||||||
\versionadded{2.5}
|
\versionadded{2.5}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getquota}{root}
|
\begin{methoddesc}[IMAP4]{getquota}{root}
|
||||||
Get the \samp{quota} \var{root}'s resource usage and limits.
|
Get the \samp{quota} \var{root}'s resource usage and limits.
|
||||||
This method is part of the IMAP4 QUOTA extension defined in rfc2087.
|
This method is part of the IMAP4 QUOTA extension defined in rfc2087.
|
||||||
\versionadded{2.3}
|
\versionadded{2.3}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getquotaroot}{mailbox}
|
\begin{methoddesc}[IMAP4]{getquotaroot}{mailbox}
|
||||||
Get the list of \samp{quota} \samp{roots} for the named \var{mailbox}.
|
Get the list of \samp{quota} \samp{roots} for the named \var{mailbox}.
|
||||||
This method is part of the IMAP4 QUOTA extension defined in rfc2087.
|
This method is part of the IMAP4 QUOTA extension defined in rfc2087.
|
||||||
\versionadded{2.3}
|
\versionadded{2.3}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{list}{\optional{directory\optional{, pattern}}}
|
\begin{methoddesc}[IMAP4]{list}{\optional{directory\optional{, pattern}}}
|
||||||
List mailbox names in \var{directory} matching
|
List mailbox names in \var{directory} matching
|
||||||
\var{pattern}. \var{directory} defaults to the top-level mail
|
\var{pattern}. \var{directory} defaults to the top-level mail
|
||||||
folder, and \var{pattern} defaults to match anything. Returned data
|
folder, and \var{pattern} defaults to match anything. Returned data
|
||||||
contains a list of \samp{LIST} responses.
|
contains a list of \samp{LIST} responses.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{login}{user, password}
|
\begin{methoddesc}[IMAP4]{login}{user, password}
|
||||||
Identify the client using a plaintext password.
|
Identify the client using a plaintext password.
|
||||||
The \var{password} will be quoted.
|
The \var{password} will be quoted.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{login_cram_md5}{user, password}
|
\begin{methoddesc}[IMAP4]{login_cram_md5}{user, password}
|
||||||
Force use of \samp{CRAM-MD5} authentication when identifying the
|
Force use of \samp{CRAM-MD5} authentication when identifying the
|
||||||
client to protect the password. Will only work if the server
|
client to protect the password. Will only work if the server
|
||||||
\samp{CAPABILITY} response includes the phrase \samp{AUTH=CRAM-MD5}.
|
\samp{CAPABILITY} response includes the phrase \samp{AUTH=CRAM-MD5}.
|
||||||
\versionadded{2.3}
|
\versionadded{2.3}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{logout}{}
|
\begin{methoddesc}[IMAP4]{logout}{}
|
||||||
Shutdown connection to server. Returns server \samp{BYE} response.
|
Shutdown connection to server. Returns server \samp{BYE} response.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{lsub}{\optional{directory\optional{, pattern}}}
|
\begin{methoddesc}[IMAP4]{lsub}{\optional{directory\optional{, pattern}}}
|
||||||
List subscribed mailbox names in directory matching pattern.
|
List subscribed mailbox names in directory matching pattern.
|
||||||
\var{directory} defaults to the top level directory and
|
\var{directory} defaults to the top level directory and
|
||||||
\var{pattern} defaults to match any mailbox.
|
\var{pattern} defaults to match any mailbox.
|
||||||
Returned data are tuples of message part envelope and data.
|
Returned data are tuples of message part envelope and data.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{myrights}{mailbox}
|
\begin{methoddesc}[IMAP4]{myrights}{mailbox}
|
||||||
Show my ACLs for a mailbox (i.e. the rights that I have on mailbox).
|
Show my ACLs for a mailbox (i.e. the rights that I have on mailbox).
|
||||||
\versionadded{2.4}
|
\versionadded{2.4}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{namespace}{}
|
\begin{methoddesc}[IMAP4]{namespace}{}
|
||||||
Returns IMAP namespaces as defined in RFC2342.
|
Returns IMAP namespaces as defined in RFC2342.
|
||||||
\versionadded{2.3}
|
\versionadded{2.3}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{noop}{}
|
\begin{methoddesc}[IMAP4]{noop}{}
|
||||||
Send \samp{NOOP} to server.
|
Send \samp{NOOP} to server.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{open}{host, port}
|
\begin{methoddesc}[IMAP4]{open}{host, port}
|
||||||
Opens socket to \var{port} at \var{host}.
|
Opens socket to \var{port} at \var{host}.
|
||||||
The connection objects established by this method
|
The connection objects established by this method
|
||||||
will be used in the \code{read}, \code{readline}, \code{send}, and
|
will be used in the \code{read}, \code{readline}, \code{send}, and
|
||||||
|
@ -292,42 +292,42 @@ data = authobject(response)
|
||||||
You may override this method.
|
You may override this method.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{partial}{message_num, message_part, start, length}
|
\begin{methoddesc}[IMAP4]{partial}{message_num, message_part, start, length}
|
||||||
Fetch truncated part of a message.
|
Fetch truncated part of a message.
|
||||||
Returned data is a tuple of message part envelope and data.
|
Returned data is a tuple of message part envelope and data.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{proxyauth}{user}
|
\begin{methoddesc}[IMAP4]{proxyauth}{user}
|
||||||
Assume authentication as \var{user}.
|
Assume authentication as \var{user}.
|
||||||
Allows an authorised administrator to proxy into any user's mailbox.
|
Allows an authorised administrator to proxy into any user's mailbox.
|
||||||
\versionadded{2.3}
|
\versionadded{2.3}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{read}{size}
|
\begin{methoddesc}[IMAP4]{read}{size}
|
||||||
Reads \var{size} bytes from the remote server.
|
Reads \var{size} bytes from the remote server.
|
||||||
You may override this method.
|
You may override this method.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{readline}{}
|
\begin{methoddesc}[IMAP4]{readline}{}
|
||||||
Reads one line from the remote server.
|
Reads one line from the remote server.
|
||||||
You may override this method.
|
You may override this method.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{recent}{}
|
\begin{methoddesc}[IMAP4]{recent}{}
|
||||||
Prompt server for an update. Returned data is \code{None} if no new
|
Prompt server for an update. Returned data is \code{None} if no new
|
||||||
messages, else value of \samp{RECENT} response.
|
messages, else value of \samp{RECENT} response.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{rename}{oldmailbox, newmailbox}
|
\begin{methoddesc}[IMAP4]{rename}{oldmailbox, newmailbox}
|
||||||
Rename mailbox named \var{oldmailbox} to \var{newmailbox}.
|
Rename mailbox named \var{oldmailbox} to \var{newmailbox}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{response}{code}
|
\begin{methoddesc}[IMAP4]{response}{code}
|
||||||
Return data for response \var{code} if received, or
|
Return data for response \var{code} if received, or
|
||||||
\code{None}. Returns the given code, instead of the usual type.
|
\code{None}. Returns the given code, instead of the usual type.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{search}{charset, criterion\optional{, ...}}
|
\begin{methoddesc}[IMAP4]{search}{charset, criterion\optional{, ...}}
|
||||||
Search mailbox for matching messages. \var{charset} may be
|
Search mailbox for matching messages. \var{charset} may be
|
||||||
\code{None}, in which case no \samp{CHARSET} will be specified in the
|
\code{None}, in which case no \samp{CHARSET} will be specified in the
|
||||||
request to the server. The IMAP protocol requires that at least one
|
request to the server. The IMAP protocol requires that at least one
|
||||||
|
@ -345,45 +345,45 @@ typ, msgnums = M.search(None, '(FROM "LDJ")')
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{select}{\optional{mailbox\optional{, readonly}}}
|
\begin{methoddesc}[IMAP4]{select}{\optional{mailbox\optional{, readonly}}}
|
||||||
Select a mailbox. Returned data is the count of messages in
|
Select a mailbox. Returned data is the count of messages in
|
||||||
\var{mailbox} (\samp{EXISTS} response). The default \var{mailbox}
|
\var{mailbox} (\samp{EXISTS} response). The default \var{mailbox}
|
||||||
is \code{'INBOX'}. If the \var{readonly} flag is set, modifications
|
is \code{'INBOX'}. If the \var{readonly} flag is set, modifications
|
||||||
to the mailbox are not allowed.
|
to the mailbox are not allowed.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{send}{data}
|
\begin{methoddesc}[IMAP4]{send}{data}
|
||||||
Sends \code{data} to the remote server.
|
Sends \code{data} to the remote server.
|
||||||
You may override this method.
|
You may override this method.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{setacl}{mailbox, who, what}
|
\begin{methoddesc}[IMAP4]{setacl}{mailbox, who, what}
|
||||||
Set an \samp{ACL} for \var{mailbox}.
|
Set an \samp{ACL} for \var{mailbox}.
|
||||||
The method is non-standard, but is supported by the \samp{Cyrus} server.
|
The method is non-standard, but is supported by the \samp{Cyrus} server.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{setannotation}{mailbox, entry, attribute\optional{, ...}}
|
\begin{methoddesc}[IMAP4]{setannotation}{mailbox, entry, attribute\optional{, ...}}
|
||||||
Set \samp{ANNOTATION}s for \var{mailbox}.
|
Set \samp{ANNOTATION}s for \var{mailbox}.
|
||||||
The method is non-standard, but is supported by the \samp{Cyrus} server.
|
The method is non-standard, but is supported by the \samp{Cyrus} server.
|
||||||
\versionadded{2.5}
|
\versionadded{2.5}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{setquota}{root, limits}
|
\begin{methoddesc}[IMAP4]{setquota}{root, limits}
|
||||||
Set the \samp{quota} \var{root}'s resource \var{limits}.
|
Set the \samp{quota} \var{root}'s resource \var{limits}.
|
||||||
This method is part of the IMAP4 QUOTA extension defined in rfc2087.
|
This method is part of the IMAP4 QUOTA extension defined in rfc2087.
|
||||||
\versionadded{2.3}
|
\versionadded{2.3}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{shutdown}{}
|
\begin{methoddesc}[IMAP4]{shutdown}{}
|
||||||
Close connection established in \code{open}.
|
Close connection established in \code{open}.
|
||||||
You may override this method.
|
You may override this method.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{socket}{}
|
\begin{methoddesc}[IMAP4]{socket}{}
|
||||||
Returns socket instance used to connect to server.
|
Returns socket instance used to connect to server.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{sort}{sort_criteria, charset, search_criterion\optional{, ...}}
|
\begin{methoddesc}[IMAP4]{sort}{sort_criteria, charset, search_criterion\optional{, ...}}
|
||||||
The \code{sort} command is a variant of \code{search} with sorting
|
The \code{sort} command is a variant of \code{search} with sorting
|
||||||
semantics for the results. Returned data contains a space separated
|
semantics for the results. Returned data contains a space separated
|
||||||
list of matching message numbers.
|
list of matching message numbers.
|
||||||
|
@ -402,11 +402,11 @@ typ, msgnums = M.search(None, '(FROM "LDJ")')
|
||||||
This is an \samp{IMAP4rev1} extension command.
|
This is an \samp{IMAP4rev1} extension command.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{status}{mailbox, names}
|
\begin{methoddesc}[IMAP4]{status}{mailbox, names}
|
||||||
Request named status conditions for \var{mailbox}.
|
Request named status conditions for \var{mailbox}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{store}{message_set, command, flag_list}
|
\begin{methoddesc}[IMAP4]{store}{message_set, command, flag_list}
|
||||||
Alters flag dispositions for messages in mailbox. \var{command} is
|
Alters flag dispositions for messages in mailbox. \var{command} is
|
||||||
specified by section 6.4.6 of \rfc{2060} as being one of "FLAGS", "+FLAGS",
|
specified by section 6.4.6 of \rfc{2060} as being one of "FLAGS", "+FLAGS",
|
||||||
or "-FLAGS", optionally with a suffix of ".SILENT".
|
or "-FLAGS", optionally with a suffix of ".SILENT".
|
||||||
|
@ -421,11 +421,11 @@ M.expunge()
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{subscribe}{mailbox}
|
\begin{methoddesc}[IMAP4]{subscribe}{mailbox}
|
||||||
Subscribe to new mailbox.
|
Subscribe to new mailbox.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{thread}{threading_algorithm, charset,
|
\begin{methoddesc}[IMAP4]{thread}{threading_algorithm, charset,
|
||||||
search_criterion\optional{, ...}}
|
search_criterion\optional{, ...}}
|
||||||
The \code{thread} command is a variant of \code{search} with
|
The \code{thread} command is a variant of \code{search} with
|
||||||
threading semantics for the results. Returned data contains a space
|
threading semantics for the results. Returned data contains a space
|
||||||
|
@ -448,18 +448,18 @@ M.expunge()
|
||||||
This is an \samp{IMAP4rev1} extension command. \versionadded{2.4}
|
This is an \samp{IMAP4rev1} extension command. \versionadded{2.4}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{uid}{command, arg\optional{, ...}}
|
\begin{methoddesc}[IMAP4]{uid}{command, arg\optional{, ...}}
|
||||||
Execute command args with messages identified by UID, rather than
|
Execute command args with messages identified by UID, rather than
|
||||||
message number. Returns response appropriate to command. At least
|
message number. Returns response appropriate to command. At least
|
||||||
one argument must be supplied; if none are provided, the server will
|
one argument must be supplied; if none are provided, the server will
|
||||||
return an error and an exception will be raised.
|
return an error and an exception will be raised.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{unsubscribe}{mailbox}
|
\begin{methoddesc}[IMAP4]{unsubscribe}{mailbox}
|
||||||
Unsubscribe from old mailbox.
|
Unsubscribe from old mailbox.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{xatom}{name\optional{, arg\optional{, ...}}}
|
\begin{methoddesc}[IMAP4]{xatom}{name\optional{, arg\optional{, ...}}}
|
||||||
Allow simple extension commands notified by server in
|
Allow simple extension commands notified by server in
|
||||||
\samp{CAPABILITY} response.
|
\samp{CAPABILITY} response.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
@ -467,7 +467,7 @@ M.expunge()
|
||||||
|
|
||||||
Instances of \class{IMAP4_SSL} have just one additional method:
|
Instances of \class{IMAP4_SSL} have just one additional method:
|
||||||
|
|
||||||
\begin{methoddesc}{ssl}{}
|
\begin{methoddesc}[IMAP4_SSL]{ssl}{}
|
||||||
Returns SSLObject instance used for the secure connection with the server.
|
Returns SSLObject instance used for the secure connection with the server.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
|
@ -475,12 +475,12 @@ Instances of \class{IMAP4_SSL} have just one additional method:
|
||||||
The following attributes are defined on instances of \class{IMAP4}:
|
The following attributes are defined on instances of \class{IMAP4}:
|
||||||
|
|
||||||
|
|
||||||
\begin{memberdesc}{PROTOCOL_VERSION}
|
\begin{memberdesc}[IMAP4]{PROTOCOL_VERSION}
|
||||||
The most recent supported protocol in the
|
The most recent supported protocol in the
|
||||||
\samp{CAPABILITY} response from the server.
|
\samp{CAPABILITY} response from the server.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{debug}
|
\begin{memberdesc}[IMAP4]{debug}
|
||||||
Integer value to control debugging output. The initialize value is
|
Integer value to control debugging output. The initialize value is
|
||||||
taken from the module variable \code{Debug}. Values greater than
|
taken from the module variable \code{Debug}. Values greater than
|
||||||
three trace each command.
|
three trace each command.
|
||||||
|
|
|
@ -1246,7 +1246,7 @@ in preference to them.
|
||||||
Older mailbox objects support only iteration and provide a single public
|
Older mailbox objects support only iteration and provide a single public
|
||||||
method:
|
method:
|
||||||
|
|
||||||
\begin{methoddesc}{next}{}
|
\begin{methoddesc}[oldmailbox]{next}{}
|
||||||
Return the next message in the mailbox, created with the optional \var{factory}
|
Return the next message in the mailbox, created with the optional \var{factory}
|
||||||
argument passed into the mailbox object's constructor. By default this is an
|
argument passed into the mailbox object's constructor. By default this is an
|
||||||
\class{rfc822.Message} object (see the \refmodule{rfc822} module). Depending
|
\class{rfc822.Message} object (see the \refmodule{rfc822} module). Depending
|
||||||
|
|
|
@ -76,7 +76,7 @@ open file \var{output}. The block size is currently fixed at 8192.
|
||||||
The \class{Message} class defines the following methods in
|
The \class{Message} class defines the following methods in
|
||||||
addition to the \class{rfc822.Message} methods:
|
addition to the \class{rfc822.Message} methods:
|
||||||
|
|
||||||
\begin{methoddesc}{getplist}{}
|
\begin{methoddesc}[Message]{getplist}{}
|
||||||
Return the parameter list of the \mailheader{Content-Type} header.
|
Return the parameter list of the \mailheader{Content-Type} header.
|
||||||
This is a list of strings. For parameters of the form
|
This is a list of strings. For parameters of the form
|
||||||
\samp{\var{key}=\var{value}}, \var{key} is converted to lower case but
|
\samp{\var{key}=\var{value}}, \var{key} is converted to lower case but
|
||||||
|
@ -86,34 +86,34 @@ This is a list of strings. For parameters of the form
|
||||||
'spam=2', 'Spam']}.
|
'spam=2', 'Spam']}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getparam}{name}
|
\begin{methoddesc}[Message]{getparam}{name}
|
||||||
Return the \var{value} of the first parameter (as returned by
|
Return the \var{value} of the first parameter (as returned by
|
||||||
\method{getplist()}) of the form \samp{\var{name}=\var{value}} for the
|
\method{getplist()}) of the form \samp{\var{name}=\var{value}} for the
|
||||||
given \var{name}. If \var{value} is surrounded by quotes of the form
|
given \var{name}. If \var{value} is surrounded by quotes of the form
|
||||||
`\code{<}...\code{>}' or `\code{"}...\code{"}', these are removed.
|
`\code{<}...\code{>}' or `\code{"}...\code{"}', these are removed.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getencoding}{}
|
\begin{methoddesc}[Message]{getencoding}{}
|
||||||
Return the encoding specified in the
|
Return the encoding specified in the
|
||||||
\mailheader{Content-Transfer-Encoding} message header. If no such
|
\mailheader{Content-Transfer-Encoding} message header. If no such
|
||||||
header exists, return \code{'7bit'}. The encoding is converted to
|
header exists, return \code{'7bit'}. The encoding is converted to
|
||||||
lower case.
|
lower case.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{gettype}{}
|
\begin{methoddesc}[Message]{gettype}{}
|
||||||
Return the message type (of the form \samp{\var{type}/\var{subtype}})
|
Return the message type (of the form \samp{\var{type}/\var{subtype}})
|
||||||
as specified in the \mailheader{Content-Type} header. If no such
|
as specified in the \mailheader{Content-Type} header. If no such
|
||||||
header exists, return \code{'text/plain'}. The type is converted to
|
header exists, return \code{'text/plain'}. The type is converted to
|
||||||
lower case.
|
lower case.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getmaintype}{}
|
\begin{methoddesc}[Message]{getmaintype}{}
|
||||||
Return the main type as specified in the \mailheader{Content-Type}
|
Return the main type as specified in the \mailheader{Content-Type}
|
||||||
header. If no such header exists, return \code{'text'}. The main
|
header. If no such header exists, return \code{'text'}. The main
|
||||||
type is converted to lower case.
|
type is converted to lower case.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getsubtype}{}
|
\begin{methoddesc}[Message]{getsubtype}{}
|
||||||
Return the subtype as specified in the \mailheader{Content-Type}
|
Return the subtype as specified in the \mailheader{Content-Type}
|
||||||
header. If no such header exists, return \code{'plain'}. The subtype
|
header. If no such header exists, return \code{'plain'}. The subtype
|
||||||
is converted to lower case.
|
is converted to lower case.
|
||||||
|
|
|
@ -178,49 +178,49 @@ An example usage of the module:
|
||||||
\class{MimeTypes} instances provide an interface which is very like
|
\class{MimeTypes} instances provide an interface which is very like
|
||||||
that of the \refmodule{mimetypes} module.
|
that of the \refmodule{mimetypes} module.
|
||||||
|
|
||||||
\begin{datadesc}{suffix_map}
|
\begin{memberdesc}[MimeTypes]{suffix_map}
|
||||||
Dictionary mapping suffixes to suffixes. This is used to allow
|
Dictionary mapping suffixes to suffixes. This is used to allow
|
||||||
recognition of encoded files for which the encoding and the type are
|
recognition of encoded files for which the encoding and the type are
|
||||||
indicated by the same extension. For example, the \file{.tgz}
|
indicated by the same extension. For example, the \file{.tgz}
|
||||||
extension is mapped to \file{.tar.gz} to allow the encoding and type
|
extension is mapped to \file{.tar.gz} to allow the encoding and type
|
||||||
to be recognized separately. This is initially a copy of the global
|
to be recognized separately. This is initially a copy of the global
|
||||||
\code{suffix_map} defined in the module.
|
\code{suffix_map} defined in the module.
|
||||||
\end{datadesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{datadesc}{encodings_map}
|
\begin{memberdesc}[MimeTypes]{encodings_map}
|
||||||
Dictionary mapping filename extensions to encoding types. This is
|
Dictionary mapping filename extensions to encoding types. This is
|
||||||
initially a copy of the global \code{encodings_map} defined in the
|
initially a copy of the global \code{encodings_map} defined in the
|
||||||
module.
|
module.
|
||||||
\end{datadesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{datadesc}{types_map}
|
\begin{memberdesc}[MimeTypes]{types_map}
|
||||||
Dictionary mapping filename extensions to MIME types. This is
|
Dictionary mapping filename extensions to MIME types. This is
|
||||||
initially a copy of the global \code{types_map} defined in the
|
initially a copy of the global \code{types_map} defined in the
|
||||||
module.
|
module.
|
||||||
\end{datadesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{datadesc}{common_types}
|
\begin{memberdesc}[MimeTypes]{common_types}
|
||||||
Dictionary mapping filename extensions to non-standard, but commonly
|
Dictionary mapping filename extensions to non-standard, but commonly
|
||||||
found MIME types. This is initially a copy of the global
|
found MIME types. This is initially a copy of the global
|
||||||
\code{common_types} defined in the module.
|
\code{common_types} defined in the module.
|
||||||
\end{datadesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{methoddesc}{guess_extension}{type\optional{, strict}}
|
\begin{methoddesc}[MimeTypes]{guess_extension}{type\optional{, strict}}
|
||||||
Similar to the \function{guess_extension()} function, using the
|
Similar to the \function{guess_extension()} function, using the
|
||||||
tables stored as part of the object.
|
tables stored as part of the object.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{guess_type}{url\optional{, strict}}
|
\begin{methoddesc}[MimeTypes]{guess_type}{url\optional{, strict}}
|
||||||
Similar to the \function{guess_type()} function, using the tables
|
Similar to the \function{guess_type()} function, using the tables
|
||||||
stored as part of the object.
|
stored as part of the object.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{read}{path}
|
\begin{methoddesc}[MimeTypes]{read}{path}
|
||||||
Load MIME information from a file named \var{path}. This uses
|
Load MIME information from a file named \var{path}. This uses
|
||||||
\method{readfp()} to parse the file.
|
\method{readfp()} to parse the file.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{readfp}{file}
|
\begin{methoddesc}[MimeTypes]{readfp}{file}
|
||||||
Load MIME type information from an open file. The file must have
|
Load MIME type information from an open file. The file must have
|
||||||
the format of the standard \file{mime.types} files.
|
the format of the standard \file{mime.types} files.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
|
@ -31,7 +31,7 @@ writing. Note that a \class{StringIO} object could also be used.
|
||||||
|
|
||||||
\class{MimeWriter} instances have the following methods:
|
\class{MimeWriter} instances have the following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{addheader}{key, value\optional{, prefix}}
|
\begin{methoddesc}[MimeWriter]{addheader}{key, value\optional{, prefix}}
|
||||||
Add a header line to the MIME message. The \var{key} is the name of
|
Add a header line to the MIME message. The \var{key} is the name of
|
||||||
the header, where the \var{value} obviously provides the value of the
|
the header, where the \var{value} obviously provides the value of the
|
||||||
header. The optional argument \var{prefix} determines where the header
|
header. The optional argument \var{prefix} determines where the header
|
||||||
|
@ -39,14 +39,14 @@ is inserted; \samp{0} means append at the end, \samp{1} is insert at
|
||||||
the start. The default is to append.
|
the start. The default is to append.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{flushheaders}{}
|
\begin{methoddesc}[MimeWriter]{flushheaders}{}
|
||||||
Causes all headers accumulated so far to be written out (and
|
Causes all headers accumulated so far to be written out (and
|
||||||
forgotten). This is useful if you don't need a body part at all,
|
forgotten). This is useful if you don't need a body part at all,
|
||||||
e.g.\ for a subpart of type \mimetype{message/rfc822} that's (mis)used
|
e.g.\ for a subpart of type \mimetype{message/rfc822} that's (mis)used
|
||||||
to store some header-like information.
|
to store some header-like information.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{startbody}{ctype\optional{, plist\optional{, prefix}}}
|
\begin{methoddesc}[MimeWriter]{startbody}{ctype\optional{, plist\optional{, prefix}}}
|
||||||
Returns a file-like object which can be used to write to the
|
Returns a file-like object which can be used to write to the
|
||||||
body of the message. The content-type is set to the provided
|
body of the message. The content-type is set to the provided
|
||||||
\var{ctype}, and the optional parameter \var{plist} provides
|
\var{ctype}, and the optional parameter \var{plist} provides
|
||||||
|
@ -55,8 +55,8 @@ functions as in \method{addheader()} except that the default is to
|
||||||
insert at the start.
|
insert at the start.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{startmultipartbody}{subtype\optional{,
|
\begin{methoddesc}[MimeWriter]{startmultipartbody}{subtype\optional{,
|
||||||
boundary\optional{, plist\optional{, prefix}}}}
|
boundary\optional{, plist\optional{, prefix}}}}
|
||||||
Returns a file-like object which can be used to write to the
|
Returns a file-like object which can be used to write to the
|
||||||
body of the message. Additionally, this method initializes the
|
body of the message. Additionally, this method initializes the
|
||||||
multi-part code, where \var{subtype} provides the multipart subtype,
|
multi-part code, where \var{subtype} provides the multipart subtype,
|
||||||
|
@ -66,7 +66,7 @@ multi-part code, where \var{subtype} provides the multipart subtype,
|
||||||
created using \method{nextpart()}.
|
created using \method{nextpart()}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{nextpart}{}
|
\begin{methoddesc}[MimeWriter]{nextpart}{}
|
||||||
Returns a new instance of \class{MimeWriter} which represents an
|
Returns a new instance of \class{MimeWriter} which represents an
|
||||||
individual part in a multipart message. This may be used to write the
|
individual part in a multipart message. This may be used to write the
|
||||||
part as well as used for creating recursively complex multipart
|
part as well as used for creating recursively complex multipart
|
||||||
|
@ -74,7 +74,7 @@ messages. The message must first be initialized with
|
||||||
\method{startmultipartbody()} before using \method{nextpart()}.
|
\method{startmultipartbody()} before using \method{nextpart()}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{lastpart}{}
|
\begin{methoddesc}[MimeWriter]{lastpart}{}
|
||||||
This is used to designate the last part of a multipart message, and
|
This is used to designate the last part of a multipart message, and
|
||||||
should \emph{always} be used when writing multipart messages.
|
should \emph{always} be used when writing multipart messages.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
|
@ -121,17 +121,17 @@ MSI routines, and standard table structures.
|
||||||
|
|
||||||
\subsection{Database Objects\label{database-objects}}
|
\subsection{Database Objects\label{database-objects}}
|
||||||
|
|
||||||
\begin{methoddesc}{OpenView}{sql}
|
\begin{methoddesc}[Database]{OpenView}{sql}
|
||||||
Return a view object, by calling \cfunction{MSIDatabaseOpenView}.
|
Return a view object, by calling \cfunction{MSIDatabaseOpenView}.
|
||||||
\var{sql} is the SQL statement to execute.
|
\var{sql} is the SQL statement to execute.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{Commit}{}
|
\begin{methoddesc}[Database]{Commit}{}
|
||||||
Commit the changes pending in the current transaction,
|
Commit the changes pending in the current transaction,
|
||||||
by calling \cfunction{MSIDatabaseCommit}.
|
by calling \cfunction{MSIDatabaseCommit}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{GetSummaryInformation}{count}
|
\begin{methoddesc}[Database]{GetSummaryInformation}{count}
|
||||||
Return a new summary information object, by calling
|
Return a new summary information object, by calling
|
||||||
\cfunction{MsiGetSummaryInformation}. \var{count} is the maximum number of
|
\cfunction{MsiGetSummaryInformation}. \var{count} is the maximum number of
|
||||||
updated values.
|
updated values.
|
||||||
|
@ -145,24 +145,24 @@ MSI routines, and standard table structures.
|
||||||
|
|
||||||
\subsection{View Objects\label{view-objects}}
|
\subsection{View Objects\label{view-objects}}
|
||||||
|
|
||||||
\begin{methoddesc}{Execute}{\optional{params=None}}
|
\begin{methoddesc}[View]{Execute}{\optional{params=None}}
|
||||||
Execute the SQL query of the view, through \cfunction{MSIViewExecute}.
|
Execute the SQL query of the view, through \cfunction{MSIViewExecute}.
|
||||||
\var{params} is an optional record describing actual values
|
\var{params} is an optional record describing actual values
|
||||||
of the parameter tokens in the query.
|
of the parameter tokens in the query.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{GetColumnInfo}{kind}
|
\begin{methoddesc}[View]{GetColumnInfo}{kind}
|
||||||
Return a record describing the columns of the view, through
|
Return a record describing the columns of the view, through
|
||||||
calling \cfunction{MsiViewGetColumnInfo}. \var{kind} can be either
|
calling \cfunction{MsiViewGetColumnInfo}. \var{kind} can be either
|
||||||
\code{MSICOLINFO_NAMES} or \code{MSICOLINFO_TYPES}.
|
\code{MSICOLINFO_NAMES} or \code{MSICOLINFO_TYPES}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{Fetch}{}
|
\begin{methoddesc}[View]{Fetch}{}
|
||||||
Return a result record of the query, through calling
|
Return a result record of the query, through calling
|
||||||
\cfunction{MsiViewFetch}.
|
\cfunction{MsiViewFetch}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{Modify}{kind, data}
|
\begin{methoddesc}[View]{Modify}{kind, data}
|
||||||
Modify the view, by calling \cfunction{MsiViewModify}. \var{kind}
|
Modify the view, by calling \cfunction{MsiViewModify}. \var{kind}
|
||||||
can be one of \code{MSIMODIFY_SEEK}, \code{MSIMODIFY_REFRESH},
|
can be one of \code{MSIMODIFY_SEEK}, \code{MSIMODIFY_REFRESH},
|
||||||
\code{MSIMODIFY_INSERT}, \code{MSIMODIFY_UPDATE}, \code{MSIMODIFY_ASSIGN},
|
\code{MSIMODIFY_INSERT}, \code{MSIMODIFY_UPDATE}, \code{MSIMODIFY_ASSIGN},
|
||||||
|
@ -174,7 +174,7 @@ MSI routines, and standard table structures.
|
||||||
\var{data} must be a record describing the new data.
|
\var{data} must be a record describing the new data.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{Close}{}
|
\begin{methoddesc}[View]{Close}{}
|
||||||
Close the view, through \cfunction{MsiViewClose}.
|
Close the view, through \cfunction{MsiViewClose}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ MSI routines, and standard table structures.
|
||||||
|
|
||||||
\subsection{Summary Information Objects\label{summary-objects}}
|
\subsection{Summary Information Objects\label{summary-objects}}
|
||||||
|
|
||||||
\begin{methoddesc}{GetProperty}{field}
|
\begin{methoddesc}[SummaryInformation]{GetProperty}{field}
|
||||||
Return a property of the summary, through \cfunction{MsiSummaryInfoGetProperty}.
|
Return a property of the summary, through \cfunction{MsiSummaryInfoGetProperty}.
|
||||||
\var{field} is the name of the property, and can be one of the
|
\var{field} is the name of the property, and can be one of the
|
||||||
constants
|
constants
|
||||||
|
@ -200,19 +200,19 @@ MSI routines, and standard table structures.
|
||||||
\code{PID_APPNAME}, or \code{PID_SECURITY}.
|
\code{PID_APPNAME}, or \code{PID_SECURITY}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{GetPropertyCount}{}
|
\begin{methoddesc}[SummaryInformation]{GetPropertyCount}{}
|
||||||
Return the number of summary properties, through
|
Return the number of summary properties, through
|
||||||
\cfunction{MsiSummaryInfoGetPropertyCount}.
|
\cfunction{MsiSummaryInfoGetPropertyCount}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{SetProperty}{field, value}
|
\begin{methoddesc}[SummaryInformation]{SetProperty}{field, value}
|
||||||
Set a property through \cfunction{MsiSummaryInfoSetProperty}. \var{field}
|
Set a property through \cfunction{MsiSummaryInfoSetProperty}. \var{field}
|
||||||
can have the same values as in \method{GetProperty}, \var{value}
|
can have the same values as in \method{GetProperty}, \var{value}
|
||||||
is the new value of the property. Possible value types are integer
|
is the new value of the property. Possible value types are integer
|
||||||
and string.
|
and string.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{Persist}{}
|
\begin{methoddesc}[SummaryInformation]{Persist}{}
|
||||||
Write the modified properties to the summary information stream,
|
Write the modified properties to the summary information stream,
|
||||||
using \cfunction{MsiSummaryInfoPersist}.
|
using \cfunction{MsiSummaryInfoPersist}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
@ -226,27 +226,27 @@ MSI routines, and standard table structures.
|
||||||
|
|
||||||
\subsection{Record Objects\label{record-objects}}
|
\subsection{Record Objects\label{record-objects}}
|
||||||
|
|
||||||
\begin{methoddesc}{GetFieldCount}{}
|
\begin{methoddesc}[Record]{GetFieldCount}{}
|
||||||
Return the number of fields of the record, through \cfunction{MsiRecordGetFieldCount}.
|
Return the number of fields of the record, through \cfunction{MsiRecordGetFieldCount}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{SetString}{field, value}
|
\begin{methoddesc}[Record]{SetString}{field, value}
|
||||||
Set \var{field} to \var{value} through \cfunction{MsiRecordSetString}.
|
Set \var{field} to \var{value} through \cfunction{MsiRecordSetString}.
|
||||||
\var{field} must be an integer; \var{value} a string.
|
\var{field} must be an integer; \var{value} a string.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{SetStream}{field, value}
|
\begin{methoddesc}[Record]{SetStream}{field, value}
|
||||||
Set \var{field} to the contents of the file named \var{value},
|
Set \var{field} to the contents of the file named \var{value},
|
||||||
through \cfunction{MsiRecordSetStream}.
|
through \cfunction{MsiRecordSetStream}.
|
||||||
\var{field} must be an integer; \var{value} a string.
|
\var{field} must be an integer; \var{value} a string.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{SetInteger}{field, value}
|
\begin{methoddesc}[Record]{SetInteger}{field, value}
|
||||||
Set \var{field} to \var{value} through \cfunction{MsiRecordSetInteger}.
|
Set \var{field} to \var{value} through \cfunction{MsiRecordSetInteger}.
|
||||||
Both \var{field} and \var{value} must be an integer.
|
Both \var{field} and \var{value} must be an integer.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{ClearData}{}
|
\begin{methoddesc}[Record]{ClearData}{}
|
||||||
Set all fields of the record to 0, through \cfunction{MsiRecordClearData}.
|
Set all fields of the record to 0, through \cfunction{MsiRecordClearData}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
|
@ -274,7 +274,7 @@ the string inside the exception will contain more detail.
|
||||||
\var{name} is the name of the CAB file in the MSI file.
|
\var{name} is the name of the CAB file in the MSI file.
|
||||||
\end{classdesc}
|
\end{classdesc}
|
||||||
|
|
||||||
\begin{methoddesc}[CAB]{append}{full, logical}
|
\begin{methoddesc}[CAB]{append}{full, file, logical}
|
||||||
Add the file with the pathname \var{full} to the CAB file,
|
Add the file with the pathname \var{full} to the CAB file,
|
||||||
under the name \var{logical}. If there is already a file
|
under the name \var{logical}. If there is already a file
|
||||||
named \var{logical}, a new file name is created.
|
named \var{logical}, a new file name is created.
|
||||||
|
@ -283,7 +283,7 @@ the string inside the exception will contain more detail.
|
||||||
new name of the file inside the CAB file.
|
new name of the file inside the CAB file.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}[CAB]{append}{database}
|
\begin{methoddesc}[CAB]{commit}{database}
|
||||||
Generate a CAB file, add it as a stream to the MSI file,
|
Generate a CAB file, add it as a stream to the MSI file,
|
||||||
put it into the \code{Media} table, and remove the generated
|
put it into the \code{Media} table, and remove the generated
|
||||||
file from the disk.
|
file from the disk.
|
||||||
|
|
|
@ -48,7 +48,7 @@ own pattern for section-divider and end-marker lines.
|
||||||
|
|
||||||
A \class{MultiFile} instance has the following methods:
|
A \class{MultiFile} instance has the following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{readline}{str}
|
\begin{methoddesc}[MultiFile]{readline}{str}
|
||||||
Read a line. If the line is data (not a section-divider or end-marker
|
Read a line. If the line is data (not a section-divider or end-marker
|
||||||
or real EOF) return it. If the line matches the most-recently-stacked
|
or real EOF) return it. If the line matches the most-recently-stacked
|
||||||
boundary, return \code{''} and set \code{self.last} to 1 or 0 according as
|
boundary, return \code{''} and set \code{self.last} to 1 or 0 according as
|
||||||
|
@ -58,33 +58,33 @@ underlying stream object, the method raises \exception{Error} unless
|
||||||
all boundaries have been popped.
|
all boundaries have been popped.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{readlines}{str}
|
\begin{methoddesc}[MultiFile]{readlines}{str}
|
||||||
Return all lines remaining in this part as a list of strings.
|
Return all lines remaining in this part as a list of strings.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{read}{}
|
\begin{methoddesc}[MultiFile]{read}{}
|
||||||
Read all lines, up to the next section. Return them as a single
|
Read all lines, up to the next section. Return them as a single
|
||||||
(multiline) string. Note that this doesn't take a size argument!
|
(multiline) string. Note that this doesn't take a size argument!
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{seek}{pos\optional{, whence}}
|
\begin{methoddesc}[MultiFile]{seek}{pos\optional{, whence}}
|
||||||
Seek. Seek indices are relative to the start of the current section.
|
Seek. Seek indices are relative to the start of the current section.
|
||||||
The \var{pos} and \var{whence} arguments are interpreted as for a file
|
The \var{pos} and \var{whence} arguments are interpreted as for a file
|
||||||
seek.
|
seek.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{tell}{}
|
\begin{methoddesc}[MultiFile]{tell}{}
|
||||||
Return the file position relative to the start of the current section.
|
Return the file position relative to the start of the current section.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{next}{}
|
\begin{methoddesc}[MultiFile]{next}{}
|
||||||
Skip lines to the next section (that is, read lines until a
|
Skip lines to the next section (that is, read lines until a
|
||||||
section-divider or end-marker has been consumed). Return true if
|
section-divider or end-marker has been consumed). Return true if
|
||||||
there is such a section, false if an end-marker is seen. Re-enable
|
there is such a section, false if an end-marker is seen. Re-enable
|
||||||
the most-recently-pushed boundary.
|
the most-recently-pushed boundary.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{is_data}{str}
|
\begin{methoddesc}[MultiFile]{is_data}{str}
|
||||||
Return true if \var{str} is data and false if it might be a section
|
Return true if \var{str} is data and false if it might be a section
|
||||||
boundary. As written, it tests for a prefix other than \code{'-}\code{-'} at
|
boundary. As written, it tests for a prefix other than \code{'-}\code{-'} at
|
||||||
start of line (which all MIME boundaries have) but it is declared so
|
start of line (which all MIME boundaries have) but it is declared so
|
||||||
|
@ -95,7 +95,7 @@ boundary tests; if it always returns false it will merely slow
|
||||||
processing, not cause it to fail.
|
processing, not cause it to fail.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{push}{str}
|
\begin{methoddesc}[MultiFile]{push}{str}
|
||||||
Push a boundary string. When a decorated version of this boundary
|
Push a boundary string. When a decorated version of this boundary
|
||||||
is found as an input line, it will be interpreted as a section-divider
|
is found as an input line, it will be interpreted as a section-divider
|
||||||
or end-marker (depending on the decoration, see \rfc{2045}). All subsequent
|
or end-marker (depending on the decoration, see \rfc{2045}). All subsequent
|
||||||
|
@ -108,12 +108,12 @@ most-recently-pushed boundary will return EOF; encountering any other
|
||||||
boundary will raise an error.
|
boundary will raise an error.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{pop}{}
|
\begin{methoddesc}[MultiFile]{pop}{}
|
||||||
Pop a section boundary. This boundary will no longer be interpreted
|
Pop a section boundary. This boundary will no longer be interpreted
|
||||||
as EOF.
|
as EOF.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{section_divider}{str}
|
\begin{methoddesc}[MultiFile]{section_divider}{str}
|
||||||
Turn a boundary into a section-divider line. By default, this
|
Turn a boundary into a section-divider line. By default, this
|
||||||
method prepends \code{'-}\code{-'} (which MIME section boundaries have) but
|
method prepends \code{'-}\code{-'} (which MIME section boundaries have) but
|
||||||
it is declared so it can be overridden in derived classes. This
|
it is declared so it can be overridden in derived classes. This
|
||||||
|
@ -121,7 +121,7 @@ method need not append LF or CR-LF, as comparison with the result
|
||||||
ignores trailing whitespace.
|
ignores trailing whitespace.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{end_marker}{str}
|
\begin{methoddesc}[MultiFile]{end_marker}{str}
|
||||||
Turn a boundary string into an end-marker line. By default, this
|
Turn a boundary string into an end-marker line. By default, this
|
||||||
method prepends \code{'-}\code{-'} and appends \code{'-}\code{-'} (like a
|
method prepends \code{'-}\code{-'} and appends \code{'-}\code{-'} (like a
|
||||||
MIME-multipart end-of-message marker) but it is declared so it can be
|
MIME-multipart end-of-message marker) but it is declared so it can be
|
||||||
|
@ -131,11 +131,11 @@ CR-LF, as comparison with the result ignores trailing whitespace.
|
||||||
|
|
||||||
Finally, \class{MultiFile} instances have two public instance variables:
|
Finally, \class{MultiFile} instances have two public instance variables:
|
||||||
|
|
||||||
\begin{memberdesc}{level}
|
\begin{memberdesc}[MultiFile]{level}
|
||||||
Nesting depth of the current part.
|
Nesting depth of the current part.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{last}
|
\begin{memberdesc}[MultiFile]{last}
|
||||||
True if the last end-of-file was for an end-of-message marker.
|
True if the last end-of-file was for an end-of-message marker.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
|
|
|
@ -35,23 +35,23 @@ acquired.
|
||||||
|
|
||||||
\class{mutex} objects have following methods:
|
\class{mutex} objects have following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{test}{}
|
\begin{methoddesc}[mutex]{test}{}
|
||||||
Check whether the mutex is locked.
|
Check whether the mutex is locked.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{testandset}{}
|
\begin{methoddesc}[mutex]{testandset}{}
|
||||||
``Atomic'' test-and-set, grab the lock if it is not set,
|
``Atomic'' test-and-set, grab the lock if it is not set,
|
||||||
and return \code{True}, otherwise, return \code{False}.
|
and return \code{True}, otherwise, return \code{False}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{lock}{function, argument}
|
\begin{methoddesc}[mutex]{lock}{function, argument}
|
||||||
Execute \code{\var{function}(\var{argument})}, unless the mutex is locked.
|
Execute \code{\var{function}(\var{argument})}, unless the mutex is locked.
|
||||||
In the case it is locked, place the function and argument on the queue.
|
In the case it is locked, place the function and argument on the queue.
|
||||||
See \method{unlock} for explanation of when
|
See \method{unlock} for explanation of when
|
||||||
\code{\var{function}(\var{argument})} is executed in that case.
|
\code{\var{function}(\var{argument})} is executed in that case.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{unlock}{}
|
\begin{methoddesc}[mutex]{unlock}{}
|
||||||
Unlock the mutex if queue is empty, otherwise execute the first element
|
Unlock the mutex if queue is empty, otherwise execute the first element
|
||||||
in the queue.
|
in the queue.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
|
@ -35,7 +35,7 @@ of the error, \member{filename} is the name of the source file, and
|
||||||
|
|
||||||
A \class{netrc} instance has the following methods:
|
A \class{netrc} instance has the following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{authenticators}{host}
|
\begin{methoddesc}[netrc]{authenticators}{host}
|
||||||
Return a 3-tuple \code{(\var{login}, \var{account}, \var{password})}
|
Return a 3-tuple \code{(\var{login}, \var{account}, \var{password})}
|
||||||
of authenticators for \var{host}. If the netrc file did not
|
of authenticators for \var{host}. If the netrc file did not
|
||||||
contain an entry for the given host, return the tuple associated with
|
contain an entry for the given host, return the tuple associated with
|
||||||
|
@ -43,20 +43,20 @@ the `default' entry. If neither matching host nor default entry is
|
||||||
available, return \code{None}.
|
available, return \code{None}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{__repr__}{}
|
\begin{methoddesc}[netrc]{__repr__}{}
|
||||||
Dump the class data as a string in the format of a netrc file.
|
Dump the class data as a string in the format of a netrc file.
|
||||||
(This discards comments and may reorder the entries.)
|
(This discards comments and may reorder the entries.)
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
Instances of \class{netrc} have public instance variables:
|
Instances of \class{netrc} have public instance variables:
|
||||||
|
|
||||||
\begin{memberdesc}{hosts}
|
\begin{memberdesc}[netrc]{hosts}
|
||||||
Dictionary mapping host names to \code{(\var{login}, \var{account},
|
Dictionary mapping host names to \code{(\var{login}, \var{account},
|
||||||
\var{password})} tuples. The `default' entry, if any, is represented
|
\var{password})} tuples. The `default' entry, if any, is represented
|
||||||
as a pseudo-host by that name.
|
as a pseudo-host by that name.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{macros}
|
\begin{memberdesc}[netrc]{macros}
|
||||||
Dictionary mapping macro names to string lists.
|
Dictionary mapping macro names to string lists.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
|
|
|
@ -121,13 +121,13 @@ If the server's response indicates an error, the method raises one of
|
||||||
the above exceptions.
|
the above exceptions.
|
||||||
|
|
||||||
|
|
||||||
\begin{methoddesc}{getwelcome}{}
|
\begin{methoddesc}[NNTP]{getwelcome}{}
|
||||||
Return the welcome message sent by the server in reply to the initial
|
Return the welcome message sent by the server in reply to the initial
|
||||||
connection. (This message sometimes contains disclaimers or help
|
connection. (This message sometimes contains disclaimers or help
|
||||||
information that may be relevant to the user.)
|
information that may be relevant to the user.)
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{set_debuglevel}{level}
|
\begin{methoddesc}[NNTP]{set_debuglevel}{level}
|
||||||
Set the instance's debugging level. This controls the amount of
|
Set the instance's debugging level. This controls the amount of
|
||||||
debugging output printed. The default, \code{0}, produces no debugging
|
debugging output printed. The default, \code{0}, produces no debugging
|
||||||
output. A value of \code{1} produces a moderate amount of debugging
|
output. A value of \code{1} produces a moderate amount of debugging
|
||||||
|
@ -137,7 +137,7 @@ logging each line sent and received on the connection (including
|
||||||
message text).
|
message text).
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{newgroups}{date, time, \optional{file}}
|
\begin{methoddesc}[NNTP]{newgroups}{date, time, \optional{file}}
|
||||||
Send a \samp{NEWGROUPS} command. The \var{date} argument should be a
|
Send a \samp{NEWGROUPS} command. The \var{date} argument should be a
|
||||||
string of the form \code{'\var{yy}\var{mm}\var{dd}'} indicating the
|
string of the form \code{'\var{yy}\var{mm}\var{dd}'} indicating the
|
||||||
date, and \var{time} should be a string of the form
|
date, and \var{time} should be a string of the form
|
||||||
|
@ -152,7 +152,7 @@ calling \method{write()} on it to store the lines of the command output.
|
||||||
If \var{file} is supplied, then the returned \var{list} is an empty list.
|
If \var{file} is supplied, then the returned \var{list} is an empty list.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{newnews}{group, date, time, \optional{file}}
|
\begin{methoddesc}[NNTP]{newnews}{group, date, time, \optional{file}}
|
||||||
Send a \samp{NEWNEWS} command. Here, \var{group} is a group name or
|
Send a \samp{NEWNEWS} command. Here, \var{group} is a group name or
|
||||||
\code{'*'}, and \var{date} and \var{time} have the same meaning as for
|
\code{'*'}, and \var{date} and \var{time} have the same meaning as for
|
||||||
\method{newgroups()}. Return a pair \code{(\var{response},
|
\method{newgroups()}. Return a pair \code{(\var{response},
|
||||||
|
@ -165,7 +165,7 @@ calling \method{write()} on it to store the lines of the command output.
|
||||||
If \var{file} is supplied, then the returned \var{list} is an empty list.
|
If \var{file} is supplied, then the returned \var{list} is an empty list.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{list}{\optional{file}}
|
\begin{methoddesc}[NNTP]{list}{\optional{file}}
|
||||||
Send a \samp{LIST} command. Return a pair \code{(\var{response},
|
Send a \samp{LIST} command. Return a pair \code{(\var{response},
|
||||||
\var{list})} where \var{list} is a list of tuples. Each tuple has the
|
\var{list})} where \var{list} is a list of tuples. Each tuple has the
|
||||||
form \code{(\var{group}, \var{last}, \var{first}, \var{flag})}, where
|
form \code{(\var{group}, \var{last}, \var{first}, \var{flag})}, where
|
||||||
|
@ -182,7 +182,7 @@ calling \method{write()} on it to store the lines of the command output.
|
||||||
If \var{file} is supplied, then the returned \var{list} is an empty list.
|
If \var{file} is supplied, then the returned \var{list} is an empty list.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{descriptions}{grouppattern}
|
\begin{methoddesc}[NNTP]{descriptions}{grouppattern}
|
||||||
Send a \samp{LIST NEWSGROUPS} command, where \var{grouppattern} is a wildmat
|
Send a \samp{LIST NEWSGROUPS} command, where \var{grouppattern} is a wildmat
|
||||||
string as specified in RFC2980 (it's essentially the same as DOS or UNIX
|
string as specified in RFC2980 (it's essentially the same as DOS or UNIX
|
||||||
shell wildcard strings). Return a pair \code{(\var{response},
|
shell wildcard strings). Return a pair \code{(\var{response},
|
||||||
|
@ -192,7 +192,7 @@ shell wildcard strings). Return a pair \code{(\var{response},
|
||||||
\versionadded{2.4}
|
\versionadded{2.4}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{description}{group}
|
\begin{methoddesc}[NNTP]{description}{group}
|
||||||
Get a description for a single group \var{group}. If more than one group
|
Get a description for a single group \var{group}. If more than one group
|
||||||
matches (if 'group' is a real wildmat string), return the first match.
|
matches (if 'group' is a real wildmat string), return the first match.
|
||||||
If no group matches, return an empty string.
|
If no group matches, return an empty string.
|
||||||
|
@ -203,7 +203,7 @@ needed, use \method{descriptions()}.
|
||||||
\versionadded{2.4}
|
\versionadded{2.4}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{group}{name}
|
\begin{methoddesc}[NNTP]{group}{name}
|
||||||
Send a \samp{GROUP} command, where \var{name} is the group name.
|
Send a \samp{GROUP} command, where \var{name} is the group name.
|
||||||
Return a tuple \code{(\var{response}, \var{count}, \var{first},
|
Return a tuple \code{(\var{response}, \var{count}, \var{first},
|
||||||
\var{last}, \var{name})} where \var{count} is the (estimated) number
|
\var{last}, \var{name})} where \var{count} is the (estimated) number
|
||||||
|
@ -212,7 +212,7 @@ the group, \var{last} is the last article number in the group, and
|
||||||
\var{name} is the group name. The numbers are returned as strings.
|
\var{name} is the group name. The numbers are returned as strings.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{help}{\optional{file}}
|
\begin{methoddesc}[NNTP]{help}{\optional{file}}
|
||||||
Send a \samp{HELP} command. Return a pair \code{(\var{response},
|
Send a \samp{HELP} command. Return a pair \code{(\var{response},
|
||||||
\var{list})} where \var{list} is a list of help strings.
|
\var{list})} where \var{list} is a list of help strings.
|
||||||
If the \var{file} parameter is supplied, then the output of the
|
If the \var{file} parameter is supplied, then the output of the
|
||||||
|
@ -223,7 +223,7 @@ calling \method{write()} on it to store the lines of the command output.
|
||||||
If \var{file} is supplied, then the returned \var{list} is an empty list.
|
If \var{file} is supplied, then the returned \var{list} is an empty list.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{stat}{id}
|
\begin{methoddesc}[NNTP]{stat}{id}
|
||||||
Send a \samp{STAT} command, where \var{id} is the message id (enclosed
|
Send a \samp{STAT} command, where \var{id} is the message id (enclosed
|
||||||
in \character{<} and \character{>}) or an article number (as a string).
|
in \character{<} and \character{>}) or an article number (as a string).
|
||||||
Return a triple \code{(\var{response}, \var{number}, \var{id})} where
|
Return a triple \code{(\var{response}, \var{number}, \var{id})} where
|
||||||
|
@ -231,15 +231,15 @@ Return a triple \code{(\var{response}, \var{number}, \var{id})} where
|
||||||
message id (enclosed in \character{<} and \character{>}).
|
message id (enclosed in \character{<} and \character{>}).
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{next}{}
|
\begin{methoddesc}[NNTP]{next}{}
|
||||||
Send a \samp{NEXT} command. Return as for \method{stat()}.
|
Send a \samp{NEXT} command. Return as for \method{stat()}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{last}{}
|
\begin{methoddesc}[NNTP]{last}{}
|
||||||
Send a \samp{LAST} command. Return as for \method{stat()}.
|
Send a \samp{LAST} command. Return as for \method{stat()}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{head}{id}
|
\begin{methoddesc}[NNTP]{head}{id}
|
||||||
Send a \samp{HEAD} command, where \var{id} has the same meaning as for
|
Send a \samp{HEAD} command, where \var{id} has the same meaning as for
|
||||||
\method{stat()}. Return a tuple
|
\method{stat()}. Return a tuple
|
||||||
\code{(\var{response}, \var{number}, \var{id}, \var{list})}
|
\code{(\var{response}, \var{number}, \var{id}, \var{list})}
|
||||||
|
@ -248,7 +248,7 @@ and \var{list} is a list of the article's headers (an uninterpreted
|
||||||
list of lines, without trailing newlines).
|
list of lines, without trailing newlines).
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{body}{id,\optional{file}}
|
\begin{methoddesc}[NNTP]{body}{id,\optional{file}}
|
||||||
Send a \samp{BODY} command, where \var{id} has the same meaning as for
|
Send a \samp{BODY} command, where \var{id} has the same meaning as for
|
||||||
\method{stat()}. If the \var{file} parameter is supplied, then
|
\method{stat()}. If the \var{file} parameter is supplied, then
|
||||||
the body is stored in a file. If \var{file} is a string, then
|
the body is stored in a file. If \var{file} is a string, then
|
||||||
|
@ -259,16 +259,16 @@ Return as for \method{head()}. If \var{file} is supplied, then
|
||||||
the returned \var{list} is an empty list.
|
the returned \var{list} is an empty list.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{article}{id}
|
\begin{methoddesc}[NNTP]{article}{id}
|
||||||
Send an \samp{ARTICLE} command, where \var{id} has the same meaning as
|
Send an \samp{ARTICLE} command, where \var{id} has the same meaning as
|
||||||
for \method{stat()}. Return as for \method{head()}.
|
for \method{stat()}. Return as for \method{head()}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{slave}{}
|
\begin{methoddesc}[NNTP]{slave}{}
|
||||||
Send a \samp{SLAVE} command. Return the server's \var{response}.
|
Send a \samp{SLAVE} command. Return the server's \var{response}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{xhdr}{header, string, \optional{file}}
|
\begin{methoddesc}[NNTP]{xhdr}{header, string, \optional{file}}
|
||||||
Send an \samp{XHDR} command. This command is not defined in the RFC
|
Send an \samp{XHDR} command. This command is not defined in the RFC
|
||||||
but is a common extension. The \var{header} argument is a header
|
but is a common extension. The \var{header} argument is a header
|
||||||
keyword, e.g. \code{'subject'}. The \var{string} argument should have
|
keyword, e.g. \code{'subject'}. The \var{string} argument should have
|
||||||
|
@ -286,7 +286,7 @@ calling \method{write()} on it to store the lines of the command output.
|
||||||
If \var{file} is supplied, then the returned \var{list} is an empty list.
|
If \var{file} is supplied, then the returned \var{list} is an empty list.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{post}{file}
|
\begin{methoddesc}[NNTP]{post}{file}
|
||||||
Post an article using the \samp{POST} command. The \var{file}
|
Post an article using the \samp{POST} command. The \var{file}
|
||||||
argument is an open file object which is read until EOF using its
|
argument is an open file object which is read until EOF using its
|
||||||
\method{readline()} method. It should be a well-formed news article,
|
\method{readline()} method. It should be a well-formed news article,
|
||||||
|
@ -294,14 +294,14 @@ including the required headers. The \method{post()} method
|
||||||
automatically escapes lines beginning with \samp{.}.
|
automatically escapes lines beginning with \samp{.}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{ihave}{id, file}
|
\begin{methoddesc}[NNTP]{ihave}{id, file}
|
||||||
Send an \samp{IHAVE} command. \var{id} is a message id (enclosed in
|
Send an \samp{IHAVE} command. \var{id} is a message id (enclosed in
|
||||||
\character{<} and \character{>}).
|
\character{<} and \character{>}).
|
||||||
If the response is not an error, treat
|
If the response is not an error, treat
|
||||||
\var{file} exactly as for the \method{post()} method.
|
\var{file} exactly as for the \method{post()} method.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{date}{}
|
\begin{methoddesc}[NNTP]{date}{}
|
||||||
Return a triple \code{(\var{response}, \var{date}, \var{time})},
|
Return a triple \code{(\var{response}, \var{date}, \var{time})},
|
||||||
containing the current date and time in a form suitable for the
|
containing the current date and time in a form suitable for the
|
||||||
\method{newnews()} and \method{newgroups()} methods.
|
\method{newnews()} and \method{newgroups()} methods.
|
||||||
|
@ -309,7 +309,7 @@ This is an optional NNTP extension, and may not be supported by all
|
||||||
servers.
|
servers.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{xgtitle}{name, \optional{file}}
|
\begin{methoddesc}[NNTP]{xgtitle}{name, \optional{file}}
|
||||||
Process an \samp{XGTITLE} command, returning a pair \code{(\var{response},
|
Process an \samp{XGTITLE} command, returning a pair \code{(\var{response},
|
||||||
\var{list})}, where \var{list} is a list of tuples containing
|
\var{list})}, where \var{list} is a list of tuples containing
|
||||||
\code{(\var{name}, \var{title})}.
|
\code{(\var{name}, \var{title})}.
|
||||||
|
@ -327,7 +327,7 @@ RFC2980 says ``It is suggested that this extension be deprecated''. Use
|
||||||
\method{descriptions()} or \method{description()} instead.
|
\method{descriptions()} or \method{description()} instead.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{xover}{start, end, \optional{file}}
|
\begin{methoddesc}[NNTP]{xover}{start, end, \optional{file}}
|
||||||
Return a pair \code{(\var{resp}, \var{list})}. \var{list} is a list
|
Return a pair \code{(\var{resp}, \var{list})}. \var{list} is a list
|
||||||
of tuples, one for each article in the range delimited by the \var{start}
|
of tuples, one for each article in the range delimited by the \var{start}
|
||||||
and \var{end} article numbers. Each tuple is of the form
|
and \var{end} article numbers. Each tuple is of the form
|
||||||
|
@ -343,13 +343,13 @@ This is an optional NNTP extension, and may not be supported by all
|
||||||
servers.
|
servers.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{xpath}{id}
|
\begin{methoddesc}[NNTP]{xpath}{id}
|
||||||
Return a pair \code{(\var{resp}, \var{path})}, where \var{path} is the
|
Return a pair \code{(\var{resp}, \var{path})}, where \var{path} is the
|
||||||
directory path to the article with message ID \var{id}. This is an
|
directory path to the article with message ID \var{id}. This is an
|
||||||
optional NNTP extension, and may not be supported by all servers.
|
optional NNTP extension, and may not be supported by all servers.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{quit}{}
|
\begin{methoddesc}[NNTP]{quit}{}
|
||||||
Send a \samp{QUIT} command and close the connection. Once this method
|
Send a \samp{QUIT} command and close the connection. Once this method
|
||||||
has been called, no other methods of the NNTP object should be called.
|
has been called, no other methods of the NNTP object should be called.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
|
@ -39,21 +39,21 @@ Example:
|
||||||
|
|
||||||
Template objects following methods:
|
Template objects following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{reset}{}
|
\begin{methoddesc}[Template]{reset}{}
|
||||||
Restore a pipeline template to its initial state.
|
Restore a pipeline template to its initial state.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{clone}{}
|
\begin{methoddesc}[Template]{clone}{}
|
||||||
Return a new, equivalent, pipeline template.
|
Return a new, equivalent, pipeline template.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{debug}{flag}
|
\begin{methoddesc}[Template]{debug}{flag}
|
||||||
If \var{flag} is true, turn debugging on. Otherwise, turn debugging
|
If \var{flag} is true, turn debugging on. Otherwise, turn debugging
|
||||||
off. When debugging is on, commands to be executed are printed, and
|
off. When debugging is on, commands to be executed are printed, and
|
||||||
the shell is given \code{set -x} command to be more verbose.
|
the shell is given \code{set -x} command to be more verbose.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{append}{cmd, kind}
|
\begin{methoddesc}[Template]{append}{cmd, kind}
|
||||||
Append a new action at the end. The \var{cmd} variable must be a valid
|
Append a new action at the end. The \var{cmd} variable must be a valid
|
||||||
bourne shell command. The \var{kind} variable consists of two letters.
|
bourne shell command. The \var{kind} variable consists of two letters.
|
||||||
|
|
||||||
|
@ -68,17 +68,17 @@ command writes a file on the command line) or \code{'.'} (which means
|
||||||
the command does not write anything, and hence must be last.)
|
the command does not write anything, and hence must be last.)
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{prepend}{cmd, kind}
|
\begin{methoddesc}[Template]{prepend}{cmd, kind}
|
||||||
Add a new action at the beginning. See \method{append()} for explanations
|
Add a new action at the beginning. See \method{append()} for explanations
|
||||||
of the arguments.
|
of the arguments.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{open}{file, mode}
|
\begin{methoddesc}[Template]{open}{file, mode}
|
||||||
Return a file-like object, open to \var{file}, but read from or
|
Return a file-like object, open to \var{file}, but read from or
|
||||||
written to by the pipeline. Note that only one of \code{'r'},
|
written to by the pipeline. Note that only one of \code{'r'},
|
||||||
\code{'w'} may be given.
|
\code{'w'} may be given.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{copy}{infile, outfile}
|
\begin{methoddesc}[Template]{copy}{infile, outfile}
|
||||||
Copy \var{infile} to \var{outfile} through the pipe.
|
Copy \var{infile} to \var{outfile} through the pipe.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
|
@ -84,12 +84,12 @@ using \function{popen4()}.
|
||||||
Instances of the \class{Popen3} and \class{Popen4} classes have the
|
Instances of the \class{Popen3} and \class{Popen4} classes have the
|
||||||
following methods:
|
following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{poll}{}
|
\begin{methoddesc}[Popen3]{poll}{}
|
||||||
Returns \code{-1} if child process hasn't completed yet, or its return
|
Returns \code{-1} if child process hasn't completed yet, or its return
|
||||||
code otherwise.
|
code otherwise.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{wait}{}
|
\begin{methoddesc}[Popen3]{wait}{}
|
||||||
Waits for and returns the status code of the child process. The
|
Waits for and returns the status code of the child process. The
|
||||||
status code encodes both the return code of the process and
|
status code encodes both the return code of the process and
|
||||||
information about whether it exited using the \cfunction{exit()}
|
information about whether it exited using the \cfunction{exit()}
|
||||||
|
@ -101,24 +101,24 @@ status code are defined in the \refmodule{os} module; see section
|
||||||
|
|
||||||
The following attributes are also available:
|
The following attributes are also available:
|
||||||
|
|
||||||
\begin{memberdesc}{fromchild}
|
\begin{memberdesc}[Popen3]{fromchild}
|
||||||
A file object that provides output from the child process. For
|
A file object that provides output from the child process. For
|
||||||
\class{Popen4} instances, this will provide both the standard output
|
\class{Popen4} instances, this will provide both the standard output
|
||||||
and standard error streams.
|
and standard error streams.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{tochild}
|
\begin{memberdesc}[Popen3]{tochild}
|
||||||
A file object that provides input to the child process.
|
A file object that provides input to the child process.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{childerr}
|
\begin{memberdesc}[Popen3]{childerr}
|
||||||
A file object that provides error output from the child process, if
|
A file object that provides error output from the child process, if
|
||||||
\var{capturestderr} was true for the constructor, otherwise
|
\var{capturestderr} was true for the constructor, otherwise
|
||||||
\code{None}. This will always be \code{None} for \class{Popen4}
|
\code{None}. This will always be \code{None} for \class{Popen4}
|
||||||
instances.
|
instances.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{pid}
|
\begin{memberdesc}[Popen3]{pid}
|
||||||
The process ID of the child process.
|
The process ID of the child process.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ in lower-case; most return the response text sent by the server.
|
||||||
An \class{POP3} instance has the following methods:
|
An \class{POP3} instance has the following methods:
|
||||||
|
|
||||||
|
|
||||||
\begin{methoddesc}{set_debuglevel}{level}
|
\begin{methoddesc}[POP3]{set_debuglevel}{level}
|
||||||
Set the instance's debugging level. This controls the amount of
|
Set the instance's debugging level. This controls the amount of
|
||||||
debugging output printed. The default, \code{0}, produces no
|
debugging output printed. The default, \code{0}, produces no
|
||||||
debugging output. A value of \code{1} produces a moderate amount of
|
debugging output. A value of \code{1} produces a moderate amount of
|
||||||
|
@ -82,64 +82,64 @@ debugging output, generally a single line per request. A value of
|
||||||
logging each line sent and received on the control connection.
|
logging each line sent and received on the control connection.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getwelcome}{}
|
\begin{methoddesc}[POP3]{getwelcome}{}
|
||||||
Returns the greeting string sent by the POP3 server.
|
Returns the greeting string sent by the POP3 server.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{user}{username}
|
\begin{methoddesc}[POP3]{user}{username}
|
||||||
Send user command, response should indicate that a password is required.
|
Send user command, response should indicate that a password is required.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{pass_}{password}
|
\begin{methoddesc}[POP3]{pass_}{password}
|
||||||
Send password, response includes message count and mailbox size.
|
Send password, response includes message count and mailbox size.
|
||||||
Note: the mailbox on the server is locked until \method{quit()} is
|
Note: the mailbox on the server is locked until \method{quit()} is
|
||||||
called.
|
called.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{apop}{user, secret}
|
\begin{methoddesc}[POP3]{apop}{user, secret}
|
||||||
Use the more secure APOP authentication to log into the POP3 server.
|
Use the more secure APOP authentication to log into the POP3 server.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{rpop}{user}
|
\begin{methoddesc}[POP3]{rpop}{user}
|
||||||
Use RPOP authentication (similar to UNIX r-commands) to log into POP3 server.
|
Use RPOP authentication (similar to UNIX r-commands) to log into POP3 server.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{stat}{}
|
\begin{methoddesc}[POP3]{stat}{}
|
||||||
Get mailbox status. The result is a tuple of 2 integers:
|
Get mailbox status. The result is a tuple of 2 integers:
|
||||||
\code{(\var{message count}, \var{mailbox size})}.
|
\code{(\var{message count}, \var{mailbox size})}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{list}{\optional{which}}
|
\begin{methoddesc}[POP3]{list}{\optional{which}}
|
||||||
Request message list, result is in the form
|
Request message list, result is in the form
|
||||||
\code{(\var{response}, ['mesg_num octets', ...], \var{octets})}.
|
\code{(\var{response}, ['mesg_num octets', ...], \var{octets})}.
|
||||||
If \var{which} is set, it is the message to list.
|
If \var{which} is set, it is the message to list.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{retr}{which}
|
\begin{methoddesc}[POP3]{retr}{which}
|
||||||
Retrieve whole message number \var{which}, and set its seen flag.
|
Retrieve whole message number \var{which}, and set its seen flag.
|
||||||
Result is in form \code{(\var{response}, ['line', ...], \var{octets})}.
|
Result is in form \code{(\var{response}, ['line', ...], \var{octets})}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{dele}{which}
|
\begin{methoddesc}[POP3]{dele}{which}
|
||||||
Flag message number \var{which} for deletion. On most servers
|
Flag message number \var{which} for deletion. On most servers
|
||||||
deletions are not actually performed until QUIT (the major exception is
|
deletions are not actually performed until QUIT (the major exception is
|
||||||
Eudora QPOP, which deliberately violates the RFCs by doing pending
|
Eudora QPOP, which deliberately violates the RFCs by doing pending
|
||||||
deletes on any disconnect).
|
deletes on any disconnect).
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{rset}{}
|
\begin{methoddesc}[POP3]{rset}{}
|
||||||
Remove any deletion marks for the mailbox.
|
Remove any deletion marks for the mailbox.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{noop}{}
|
\begin{methoddesc}[POP3]{noop}{}
|
||||||
Do nothing. Might be used as a keep-alive.
|
Do nothing. Might be used as a keep-alive.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{quit}{}
|
\begin{methoddesc}[POP3]{quit}{}
|
||||||
Signoff: commit changes, unlock mailbox, drop connection.
|
Signoff: commit changes, unlock mailbox, drop connection.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{top}{which, howmuch}
|
\begin{methoddesc}[POP3]{top}{which, howmuch}
|
||||||
Retrieves the message header plus \var{howmuch} lines of the message
|
Retrieves the message header plus \var{howmuch} lines of the message
|
||||||
after the header of message number \var{which}. Result is in form
|
after the header of message number \var{which}. Result is in form
|
||||||
\code{(\var{response}, ['line', ...], \var{octets})}.
|
\code{(\var{response}, ['line', ...], \var{octets})}.
|
||||||
|
@ -151,7 +151,7 @@ Test this method by hand against the POP3 servers you will use before
|
||||||
trusting it.
|
trusting it.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{uidl}{\optional{which}}
|
\begin{methoddesc}[POP3]{uidl}{\optional{which}}
|
||||||
Return message digest (unique id) list.
|
Return message digest (unique id) list.
|
||||||
If \var{which} is specified, result contains the unique id for that
|
If \var{which} is specified, result contains the unique id for that
|
||||||
message in the form \code{'\var{response}\ \var{mesgnum}\ \var{uid}},
|
message in the form \code{'\var{response}\ \var{mesgnum}\ \var{uid}},
|
||||||
|
|
|
@ -158,12 +158,12 @@ l/lib/python1.5/test', '/usr/local/lib/python1.5/sunos5', '/usr/local/lib/python
|
||||||
\class{PrettyPrinter} instances have the following methods:
|
\class{PrettyPrinter} instances have the following methods:
|
||||||
|
|
||||||
|
|
||||||
\begin{methoddesc}{pformat}{object}
|
\begin{methoddesc}[PrettyPrinter]{pformat}{object}
|
||||||
Return the formatted representation of \var{object}. This takes into
|
Return the formatted representation of \var{object}. This takes into
|
||||||
account the options passed to the \class{PrettyPrinter} constructor.
|
account the options passed to the \class{PrettyPrinter} constructor.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{pprint}{object}
|
\begin{methoddesc}[PrettyPrinter]{pprint}{object}
|
||||||
Print the formatted representation of \var{object} on the configured
|
Print the formatted representation of \var{object} on the configured
|
||||||
stream, followed by a newline.
|
stream, followed by a newline.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
@ -173,7 +173,7 @@ corresponding functions of the same names. Using these methods on an
|
||||||
instance is slightly more efficient since new \class{PrettyPrinter}
|
instance is slightly more efficient since new \class{PrettyPrinter}
|
||||||
objects don't need to be created.
|
objects don't need to be created.
|
||||||
|
|
||||||
\begin{methoddesc}{isreadable}{object}
|
\begin{methoddesc}[PrettyPrinter]{isreadable}{object}
|
||||||
Determine if the formatted representation of the object is
|
Determine if the formatted representation of the object is
|
||||||
``readable,'' or can be used to reconstruct the value using
|
``readable,'' or can be used to reconstruct the value using
|
||||||
\function{eval()}\bifuncindex{eval}. Note that this returns false for
|
\function{eval()}\bifuncindex{eval}. Note that this returns false for
|
||||||
|
@ -182,7 +182,7 @@ recursive objects. If the \var{depth} parameter of the
|
||||||
this returns false.
|
this returns false.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{isrecursive}{object}
|
\begin{methoddesc}[PrettyPrinter]{isrecursive}{object}
|
||||||
Determine if the object requires a recursive representation.
|
Determine if the object requires a recursive representation.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ This method is provided as a hook to allow subclasses to modify the
|
||||||
way objects are converted to strings. The default implementation uses
|
way objects are converted to strings. The default implementation uses
|
||||||
the internals of the \function{saferepr()} implementation.
|
the internals of the \function{saferepr()} implementation.
|
||||||
|
|
||||||
\begin{methoddesc}{format}{object, context, maxlevels, level}
|
\begin{methoddesc}[PrettyPrinter]{format}{object, context, maxlevels, level}
|
||||||
Returns three values: the formatted version of \var{object} as a
|
Returns three values: the formatted version of \var{object} as a
|
||||||
string, a flag indicating whether the result is readable, and a flag
|
string, a flag indicating whether the result is readable, and a flag
|
||||||
indicating whether recursion was detected. The first argument is the
|
indicating whether recursion was detected. The first argument is the
|
||||||
|
|
|
@ -45,22 +45,22 @@ other queue organizations (e.g. stack) but the inheritable interface
|
||||||
is not described here. See the source code for details. The public
|
is not described here. See the source code for details. The public
|
||||||
methods are:
|
methods are:
|
||||||
|
|
||||||
\begin{methoddesc}{qsize}{}
|
\begin{methoddesc}[Queue]{qsize}{}
|
||||||
Return the approximate size of the queue. Because of multithreading
|
Return the approximate size of the queue. Because of multithreading
|
||||||
semantics, this number is not reliable.
|
semantics, this number is not reliable.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{empty}{}
|
\begin{methoddesc}[Queue]{empty}{}
|
||||||
Return \code{True} if the queue is empty, \code{False} otherwise.
|
Return \code{True} if the queue is empty, \code{False} otherwise.
|
||||||
Because of multithreading semantics, this is not reliable.
|
Because of multithreading semantics, this is not reliable.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{full}{}
|
\begin{methoddesc}[Queue]{full}{}
|
||||||
Return \code{True} if the queue is full, \code{False} otherwise.
|
Return \code{True} if the queue is full, \code{False} otherwise.
|
||||||
Because of multithreading semantics, this is not reliable.
|
Because of multithreading semantics, this is not reliable.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{put}{item\optional{, block\optional{, timeout}}}
|
\begin{methoddesc}[Queue]{put}{item\optional{, block\optional{, timeout}}}
|
||||||
Put \var{item} into the queue. If optional args \var{block} is true
|
Put \var{item} into the queue. If optional args \var{block} is true
|
||||||
and \var{timeout} is None (the default), block if necessary until a
|
and \var{timeout} is None (the default), block if necessary until a
|
||||||
free slot is available. If \var{timeout} is a positive number, it
|
free slot is available. If \var{timeout} is a positive number, it
|
||||||
|
@ -74,11 +74,11 @@ exception (\var{timeout} is ignored in that case).
|
||||||
|
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{put_nowait}{item}
|
\begin{methoddesc}[Queue]{put_nowait}{item}
|
||||||
Equivalent to \code{put(\var{item}, False)}.
|
Equivalent to \code{put(\var{item}, False)}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{get}{\optional{block\optional{, timeout}}}
|
\begin{methoddesc}[Queue]{get}{\optional{block\optional{, timeout}}}
|
||||||
Remove and return an item from the queue. If optional args
|
Remove and return an item from the queue. If optional args
|
||||||
\var{block} is true and \var{timeout} is None (the default),
|
\var{block} is true and \var{timeout} is None (the default),
|
||||||
block if necessary until an item is available. If \var{timeout} is
|
block if necessary until an item is available. If \var{timeout} is
|
||||||
|
@ -92,14 +92,14 @@ immediately available, else raise the \exception{Empty} exception
|
||||||
|
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{get_nowait}{}
|
\begin{methoddesc}[Queue]{get_nowait}{}
|
||||||
Equivalent to \code{get(False)}.
|
Equivalent to \code{get(False)}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
Two methods are offered to support tracking whether enqueued tasks have
|
Two methods are offered to support tracking whether enqueued tasks have
|
||||||
been fully processed by daemon consumer threads.
|
been fully processed by daemon consumer threads.
|
||||||
|
|
||||||
\begin{methoddesc}{task_done}{}
|
\begin{methoddesc}[Queue]{task_done}{}
|
||||||
Indicate that a formerly enqueued task is complete. Used by queue consumer
|
Indicate that a formerly enqueued task is complete. Used by queue consumer
|
||||||
threads. For each \method{get()} used to fetch a task, a subsequent call to
|
threads. For each \method{get()} used to fetch a task, a subsequent call to
|
||||||
\method{task_done()} tells the queue that the processing on the task is complete.
|
\method{task_done()} tells the queue that the processing on the task is complete.
|
||||||
|
@ -113,7 +113,7 @@ placed in the queue.
|
||||||
\versionadded{2.5}
|
\versionadded{2.5}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{join}{}
|
\begin{methoddesc}[Queue]{join}{}
|
||||||
Blocks until all items in the queue have been gotten and processed.
|
Blocks until all items in the queue have been gotten and processed.
|
||||||
|
|
||||||
The count of unfinished tasks goes up whenever an item is added to the
|
The count of unfinished tasks goes up whenever an item is added to the
|
||||||
|
|
|
@ -44,18 +44,18 @@ provide size limits for the representations of different object types,
|
||||||
and methods which format specific object types.
|
and methods which format specific object types.
|
||||||
|
|
||||||
|
|
||||||
\begin{memberdesc}{maxlevel}
|
\begin{memberdesc}[Repr]{maxlevel}
|
||||||
Depth limit on the creation of recursive representations. The
|
Depth limit on the creation of recursive representations. The
|
||||||
default is \code{6}.
|
default is \code{6}.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{maxdict}
|
\begin{memberdesc}[Repr]{maxdict}
|
||||||
\memberline{maxlist}
|
\memberline[Repr]{maxlist}
|
||||||
\memberline{maxtuple}
|
\memberline[Repr]{maxtuple}
|
||||||
\memberline{maxset}
|
\memberline[Repr]{maxset}
|
||||||
\memberline{maxfrozenset}
|
\memberline[Repr]{maxfrozenset}
|
||||||
\memberline{maxdeque}
|
\memberline[Repr]{maxdeque}
|
||||||
\memberline{maxarray}
|
\memberline[Repr]{maxarray}
|
||||||
Limits on the number of entries represented for the named object
|
Limits on the number of entries represented for the named object
|
||||||
type. The default is \code{4} for \member{maxdict}, \code{5} for
|
type. The default is \code{4} for \member{maxdict}, \code{5} for
|
||||||
\member{maxarray}, and \code{6} for the others.
|
\member{maxarray}, and \code{6} for the others.
|
||||||
|
@ -63,13 +63,13 @@ and methods which format specific object types.
|
||||||
and \member{set}]{2.4}.
|
and \member{set}]{2.4}.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{maxlong}
|
\begin{memberdesc}[Repr]{maxlong}
|
||||||
Maximum number of characters in the representation for a long
|
Maximum number of characters in the representation for a long
|
||||||
integer. Digits are dropped from the middle. The default is
|
integer. Digits are dropped from the middle. The default is
|
||||||
\code{40}.
|
\code{40}.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{maxstring}
|
\begin{memberdesc}[Repr]{maxstring}
|
||||||
Limit on the number of characters in the representation of the
|
Limit on the number of characters in the representation of the
|
||||||
string. Note that the ``normal'' representation of the string is
|
string. Note that the ``normal'' representation of the string is
|
||||||
used as the character source: if escape sequences are needed in the
|
used as the character source: if escape sequences are needed in the
|
||||||
|
@ -77,19 +77,19 @@ and methods which format specific object types.
|
||||||
shortened. The default is \code{30}.
|
shortened. The default is \code{30}.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{maxother}
|
\begin{memberdesc}[Repr]{maxother}
|
||||||
This limit is used to control the size of object types for which no
|
This limit is used to control the size of object types for which no
|
||||||
specific formatting method is available on the \class{Repr} object.
|
specific formatting method is available on the \class{Repr} object.
|
||||||
It is applied in a similar manner as \member{maxstring}. The
|
It is applied in a similar manner as \member{maxstring}. The
|
||||||
default is \code{20}.
|
default is \code{20}.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{methoddesc}{repr}{obj}
|
\begin{methoddesc}[Repr]{repr}{obj}
|
||||||
The equivalent to the built-in \function{repr()} that uses the
|
The equivalent to the built-in \function{repr()} that uses the
|
||||||
formatting imposed by the instance.
|
formatting imposed by the instance.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{repr1}{obj, level}
|
\begin{methoddesc}[Repr]{repr1}{obj, level}
|
||||||
Recursive implementation used by \method{repr()}. This uses the
|
Recursive implementation used by \method{repr()}. This uses the
|
||||||
type of \var{obj} to determine which formatting method to call,
|
type of \var{obj} to determine which formatting method to call,
|
||||||
passing it \var{obj} and \var{level}. The type-specific methods
|
passing it \var{obj} and \var{level}. The type-specific methods
|
||||||
|
@ -98,7 +98,7 @@ and methods which format specific object types.
|
||||||
call.
|
call.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddescni}{repr_\var{type}}{obj, level}
|
\begin{methoddescni}[Repr]{repr_\var{type}}{obj, level}
|
||||||
Formatting methods for specific types are implemented as methods
|
Formatting methods for specific types are implemented as methods
|
||||||
with a name based on the type name. In the method name, \var{type}
|
with a name based on the type name. In the method name, \var{type}
|
||||||
is replaced by
|
is replaced by
|
||||||
|
|
|
@ -89,20 +89,20 @@ makes use of this and would break were it not available.
|
||||||
|
|
||||||
\class{RExec} instances support the following methods:
|
\class{RExec} instances support the following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{r_eval}{code}
|
\begin{methoddesc}[RExec]{r_eval}{code}
|
||||||
\var{code} must either be a string containing a Python expression, or
|
\var{code} must either be a string containing a Python expression, or
|
||||||
a compiled code object, which will be evaluated in the restricted
|
a compiled code object, which will be evaluated in the restricted
|
||||||
environment's \module{__main__} module. The value of the expression or
|
environment's \module{__main__} module. The value of the expression or
|
||||||
code object will be returned.
|
code object will be returned.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{r_exec}{code}
|
\begin{methoddesc}[RExec]{r_exec}{code}
|
||||||
\var{code} must either be a string containing one or more lines of
|
\var{code} must either be a string containing one or more lines of
|
||||||
Python code, or a compiled code object, which will be executed in the
|
Python code, or a compiled code object, which will be executed in the
|
||||||
restricted environment's \module{__main__} module.
|
restricted environment's \module{__main__} module.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{r_execfile}{filename}
|
\begin{methoddesc}[RExec]{r_execfile}{filename}
|
||||||
Execute the Python code contained in the file \var{filename} in the
|
Execute the Python code contained in the file \var{filename} in the
|
||||||
restricted environment's \module{__main__} module.
|
restricted environment's \module{__main__} module.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
@ -112,17 +112,17 @@ beginning with \samp{r_}, but the code will be granted access to
|
||||||
restricted versions of the standard I/O streams \code{sys.stdin},
|
restricted versions of the standard I/O streams \code{sys.stdin},
|
||||||
\code{sys.stderr}, and \code{sys.stdout}.
|
\code{sys.stderr}, and \code{sys.stdout}.
|
||||||
|
|
||||||
\begin{methoddesc}{s_eval}{code}
|
\begin{methoddesc}[RExec]{s_eval}{code}
|
||||||
\var{code} must be a string containing a Python expression, which will
|
\var{code} must be a string containing a Python expression, which will
|
||||||
be evaluated in the restricted environment.
|
be evaluated in the restricted environment.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{s_exec}{code}
|
\begin{methoddesc}[RExec]{s_exec}{code}
|
||||||
\var{code} must be a string containing one or more lines of Python code,
|
\var{code} must be a string containing one or more lines of Python code,
|
||||||
which will be executed in the restricted environment.
|
which will be executed in the restricted environment.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{s_execfile}{code}
|
\begin{methoddesc}[RExec]{s_execfile}{code}
|
||||||
Execute the Python code contained in the file \var{filename} in the
|
Execute the Python code contained in the file \var{filename} in the
|
||||||
restricted environment.
|
restricted environment.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
@ -132,13 +132,13 @@ implicitly called by code executing in the restricted environment.
|
||||||
Overriding these methods in a subclass is used to change the policies
|
Overriding these methods in a subclass is used to change the policies
|
||||||
enforced by a restricted environment.
|
enforced by a restricted environment.
|
||||||
|
|
||||||
\begin{methoddesc}{r_import}{modulename\optional{, globals\optional{,
|
\begin{methoddesc}[RExec]{r_import}{modulename\optional{, globals\optional{,
|
||||||
locals\optional{, fromlist}}}}
|
locals\optional{, fromlist}}}}
|
||||||
Import the module \var{modulename}, raising an \exception{ImportError}
|
Import the module \var{modulename}, raising an \exception{ImportError}
|
||||||
exception if the module is considered unsafe.
|
exception if the module is considered unsafe.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{r_open}{filename\optional{, mode\optional{, bufsize}}}
|
\begin{methoddesc}[RExec]{r_open}{filename\optional{, mode\optional{, bufsize}}}
|
||||||
Method called when \function{open()} is called in the restricted
|
Method called when \function{open()} is called in the restricted
|
||||||
environment. The arguments are identical to those of \function{open()},
|
environment. The arguments are identical to those of \function{open()},
|
||||||
and a file object (or a class instance compatible with file objects)
|
and a file object (or a class instance compatible with file objects)
|
||||||
|
@ -148,28 +148,28 @@ the example below for an implementation of a less restrictive
|
||||||
\method{r_open()}.
|
\method{r_open()}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{r_reload}{module}
|
\begin{methoddesc}[RExec]{r_reload}{module}
|
||||||
Reload the module object \var{module}, re-parsing and re-initializing it.
|
Reload the module object \var{module}, re-parsing and re-initializing it.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{r_unload}{module}
|
\begin{methoddesc}[RExec]{r_unload}{module}
|
||||||
Unload the module object \var{module} (remove it from the
|
Unload the module object \var{module} (remove it from the
|
||||||
restricted environment's \code{sys.modules} dictionary).
|
restricted environment's \code{sys.modules} dictionary).
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
And their equivalents with access to restricted standard I/O streams:
|
And their equivalents with access to restricted standard I/O streams:
|
||||||
|
|
||||||
\begin{methoddesc}{s_import}{modulename\optional{, globals\optional{,
|
\begin{methoddesc}[RExec]{s_import}{modulename\optional{, globals\optional{,
|
||||||
locals\optional{, fromlist}}}}
|
locals\optional{, fromlist}}}}
|
||||||
Import the module \var{modulename}, raising an \exception{ImportError}
|
Import the module \var{modulename}, raising an \exception{ImportError}
|
||||||
exception if the module is considered unsafe.
|
exception if the module is considered unsafe.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{s_reload}{module}
|
\begin{methoddesc}[RExec]{s_reload}{module}
|
||||||
Reload the module object \var{module}, re-parsing and re-initializing it.
|
Reload the module object \var{module}, re-parsing and re-initializing it.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{s_unload}{module}
|
\begin{methoddesc}[RExec]{s_unload}{module}
|
||||||
Unload the module object \var{module}.
|
Unload the module object \var{module}.
|
||||||
% XXX what are the semantics of this?
|
% XXX what are the semantics of this?
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
@ -184,7 +184,7 @@ instance won't have any effect; instead, create a subclass of
|
||||||
Instances of the new class will then use those new values. All these
|
Instances of the new class will then use those new values. All these
|
||||||
attributes are tuples of strings.
|
attributes are tuples of strings.
|
||||||
|
|
||||||
\begin{memberdesc}{nok_builtin_names}
|
\begin{memberdesc}[RExec]{nok_builtin_names}
|
||||||
Contains the names of built-in functions which will \emph{not} be
|
Contains the names of built-in functions which will \emph{not} be
|
||||||
available to programs running in the restricted environment. The
|
available to programs running in the restricted environment. The
|
||||||
value for \class{RExec} is \code{('open', 'reload', '__import__')}.
|
value for \class{RExec} is \code{('open', 'reload', '__import__')}.
|
||||||
|
@ -196,7 +196,7 @@ built-in functions are added to Python, they will also be added to
|
||||||
this module.)
|
this module.)
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{ok_builtin_modules}
|
\begin{memberdesc}[RExec]{ok_builtin_modules}
|
||||||
Contains the names of built-in modules which can be safely imported.
|
Contains the names of built-in modules which can be safely imported.
|
||||||
The value for \class{RExec} is \code{('audioop', 'array', 'binascii',
|
The value for \class{RExec} is \code{('audioop', 'array', 'binascii',
|
||||||
'cmath', 'errno', 'imageop', 'marshal', 'math', 'md5', 'operator',
|
'cmath', 'errno', 'imageop', 'marshal', 'math', 'md5', 'operator',
|
||||||
|
@ -205,14 +205,14 @@ The value for \class{RExec} is \code{('audioop', 'array', 'binascii',
|
||||||
applies --- use the value from the base class as a starting point.
|
applies --- use the value from the base class as a starting point.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{ok_path}
|
\begin{memberdesc}[RExec]{ok_path}
|
||||||
Contains the directories which will be searched when an \keyword{import}
|
Contains the directories which will be searched when an \keyword{import}
|
||||||
is performed in the restricted environment.
|
is performed in the restricted environment.
|
||||||
The value for \class{RExec} is the same as \code{sys.path} (at the time
|
The value for \class{RExec} is the same as \code{sys.path} (at the time
|
||||||
the module is loaded) for unrestricted code.
|
the module is loaded) for unrestricted code.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{ok_posix_names}
|
\begin{memberdesc}[RExec]{ok_posix_names}
|
||||||
% Should this be called ok_os_names?
|
% Should this be called ok_os_names?
|
||||||
Contains the names of the functions in the \refmodule{os} module which will be
|
Contains the names of the functions in the \refmodule{os} module which will be
|
||||||
available to programs running in the restricted environment. The
|
available to programs running in the restricted environment. The
|
||||||
|
@ -221,14 +221,14 @@ value for \class{RExec} is \code{('error', 'fstat', 'listdir',
|
||||||
'getcwd', 'getuid', 'getgid', 'geteuid', 'getegid')}.
|
'getcwd', 'getuid', 'getgid', 'geteuid', 'getegid')}.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{ok_sys_names}
|
\begin{memberdesc}[RExec]{ok_sys_names}
|
||||||
Contains the names of the functions and variables in the \refmodule{sys}
|
Contains the names of the functions and variables in the \refmodule{sys}
|
||||||
module which will be available to programs running in the restricted
|
module which will be available to programs running in the restricted
|
||||||
environment. The value for \class{RExec} is \code{('ps1', 'ps2',
|
environment. The value for \class{RExec} is \code{('ps1', 'ps2',
|
||||||
'copyright', 'version', 'platform', 'exit', 'maxint')}.
|
'copyright', 'version', 'platform', 'exit', 'maxint')}.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{ok_file_types}
|
\begin{memberdesc}[RExec]{ok_file_types}
|
||||||
Contains the file types from which modules are allowed to be loaded.
|
Contains the file types from which modules are allowed to be loaded.
|
||||||
Each file type is an integer constant defined in the \refmodule{imp} module.
|
Each file type is an integer constant defined in the \refmodule{imp} module.
|
||||||
The meaningful values are \constant{PY_SOURCE}, \constant{PY_COMPILED}, and
|
The meaningful values are \constant{PY_SOURCE}, \constant{PY_COMPILED}, and
|
||||||
|
|
|
@ -142,12 +142,12 @@ switch dates. Not enough to worry about for common use.
|
||||||
|
|
||||||
A \class{Message} instance has the following methods:
|
A \class{Message} instance has the following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{rewindbody}{}
|
\begin{methoddesc}[Message]{rewindbody}{}
|
||||||
Seek to the start of the message body. This only works if the file
|
Seek to the start of the message body. This only works if the file
|
||||||
object is seekable.
|
object is seekable.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{isheader}{line}
|
\begin{methoddesc}[Message]{isheader}{line}
|
||||||
Returns a line's canonicalized fieldname (the dictionary key that will
|
Returns a line's canonicalized fieldname (the dictionary key that will
|
||||||
be used to index it) if the line is a legal \rfc{2822} header; otherwise
|
be used to index it) if the line is a legal \rfc{2822} header; otherwise
|
||||||
returns \code{None} (implying that parsing should stop here and the
|
returns \code{None} (implying that parsing should stop here and the
|
||||||
|
@ -155,33 +155,33 @@ line be pushed back on the input stream). It is sometimes useful to
|
||||||
override this method in a subclass.
|
override this method in a subclass.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{islast}{line}
|
\begin{methoddesc}[Message]{islast}{line}
|
||||||
Return true if the given line is a delimiter on which Message should
|
Return true if the given line is a delimiter on which Message should
|
||||||
stop. The delimiter line is consumed, and the file object's read
|
stop. The delimiter line is consumed, and the file object's read
|
||||||
location positioned immediately after it. By default this method just
|
location positioned immediately after it. By default this method just
|
||||||
checks that the line is blank, but you can override it in a subclass.
|
checks that the line is blank, but you can override it in a subclass.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{iscomment}{line}
|
\begin{methoddesc}[Message]{iscomment}{line}
|
||||||
Return \code{True} if the given line should be ignored entirely, just skipped.
|
Return \code{True} if the given line should be ignored entirely, just skipped.
|
||||||
By default this is a stub that always returns \code{False}, but you can
|
By default this is a stub that always returns \code{False}, but you can
|
||||||
override it in a subclass.
|
override it in a subclass.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getallmatchingheaders}{name}
|
\begin{methoddesc}[Message]{getallmatchingheaders}{name}
|
||||||
Return a list of lines consisting of all headers matching
|
Return a list of lines consisting of all headers matching
|
||||||
\var{name}, if any. Each physical line, whether it is a continuation
|
\var{name}, if any. Each physical line, whether it is a continuation
|
||||||
line or not, is a separate list item. Return the empty list if no
|
line or not, is a separate list item. Return the empty list if no
|
||||||
header matches \var{name}.
|
header matches \var{name}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getfirstmatchingheader}{name}
|
\begin{methoddesc}[Message]{getfirstmatchingheader}{name}
|
||||||
Return a list of lines comprising the first header matching
|
Return a list of lines comprising the first header matching
|
||||||
\var{name}, and its continuation line(s), if any. Return
|
\var{name}, and its continuation line(s), if any. Return
|
||||||
\code{None} if there is no header matching \var{name}.
|
\code{None} if there is no header matching \var{name}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getrawheader}{name}
|
\begin{methoddesc}[Message]{getrawheader}{name}
|
||||||
Return a single string consisting of the text after the colon in the
|
Return a single string consisting of the text after the colon in the
|
||||||
first header matching \var{name}. This includes leading whitespace,
|
first header matching \var{name}. This includes leading whitespace,
|
||||||
the trailing linefeed, and internal linefeeds and whitespace if there
|
the trailing linefeed, and internal linefeeds and whitespace if there
|
||||||
|
@ -189,19 +189,19 @@ any continuation line(s) were present. Return \code{None} if there is
|
||||||
no header matching \var{name}.
|
no header matching \var{name}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getheader}{name\optional{, default}}
|
\begin{methoddesc}[Message]{getheader}{name\optional{, default}}
|
||||||
Like \code{getrawheader(\var{name})}, but strip leading and trailing
|
Like \code{getrawheader(\var{name})}, but strip leading and trailing
|
||||||
whitespace. Internal whitespace is not stripped. The optional
|
whitespace. Internal whitespace is not stripped. The optional
|
||||||
\var{default} argument can be used to specify a different default to
|
\var{default} argument can be used to specify a different default to
|
||||||
be returned when there is no header matching \var{name}.
|
be returned when there is no header matching \var{name}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{get}{name\optional{, default}}
|
\begin{methoddesc}[Message]{get}{name\optional{, default}}
|
||||||
An alias for \method{getheader()}, to make the interface more compatible
|
An alias for \method{getheader()}, to make the interface more compatible
|
||||||
with regular dictionaries.
|
with regular dictionaries.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getaddr}{name}
|
\begin{methoddesc}[Message]{getaddr}{name}
|
||||||
Return a pair \code{(\var{full name}, \var{email address})} parsed
|
Return a pair \code{(\var{full name}, \var{email address})} parsed
|
||||||
from the string returned by \code{getheader(\var{name})}. If no
|
from the string returned by \code{getheader(\var{name})}. If no
|
||||||
header matching \var{name} exists, return \code{(None, None)};
|
header matching \var{name} exists, return \code{(None, None)};
|
||||||
|
@ -217,7 +217,7 @@ If the header contained
|
||||||
exact same result.
|
exact same result.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getaddrlist}{name}
|
\begin{methoddesc}[Message]{getaddrlist}{name}
|
||||||
This is similar to \code{getaddr(\var{list})}, but parses a header
|
This is similar to \code{getaddr(\var{list})}, but parses a header
|
||||||
containing a list of email addresses (e.g.\ a \mailheader{To} header) and
|
containing a list of email addresses (e.g.\ a \mailheader{To} header) and
|
||||||
returns a list of \code{(\var{full name}, \var{email address})} pairs
|
returns a list of \code{(\var{full name}, \var{email address})} pairs
|
||||||
|
@ -229,7 +229,7 @@ are several \mailheader{Cc} headers), all are parsed for addresses.
|
||||||
Any continuation lines the named headers contain are also parsed.
|
Any continuation lines the named headers contain are also parsed.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getdate}{name}
|
\begin{methoddesc}[Message]{getdate}{name}
|
||||||
Retrieve a header using \method{getheader()} and parse it into a 9-tuple
|
Retrieve a header using \method{getheader()} and parse it into a 9-tuple
|
||||||
compatible with \function{time.mktime()}; note that fields 6, 7, and 8
|
compatible with \function{time.mktime()}; note that fields 6, 7, and 8
|
||||||
are not usable. If there is no header matching
|
are not usable. If there is no header matching
|
||||||
|
@ -241,7 +241,7 @@ collection of email from many sources, it is still possible that this
|
||||||
function may occasionally yield an incorrect result.
|
function may occasionally yield an incorrect result.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{getdate_tz}{name}
|
\begin{methoddesc}[Message]{getdate_tz}{name}
|
||||||
Retrieve a header using \method{getheader()} and parse it into a
|
Retrieve a header using \method{getheader()} and parse it into a
|
||||||
10-tuple; the first 9 elements will make a tuple compatible with
|
10-tuple; the first 9 elements will make a tuple compatible with
|
||||||
\function{time.mktime()}, and the 10th is a number giving the offset
|
\function{time.mktime()}, and the 10th is a number giving the offset
|
||||||
|
@ -270,19 +270,19 @@ support the \method{clear()}, \method{copy()}, \method{popitem()}, or
|
||||||
|
|
||||||
Finally, \class{Message} instances have some public instance variables:
|
Finally, \class{Message} instances have some public instance variables:
|
||||||
|
|
||||||
\begin{memberdesc}{headers}
|
\begin{memberdesc}[Message]{headers}
|
||||||
A list containing the entire set of header lines, in the order in
|
A list containing the entire set of header lines, in the order in
|
||||||
which they were read (except that setitem calls may disturb this
|
which they were read (except that setitem calls may disturb this
|
||||||
order). Each line contains a trailing newline. The
|
order). Each line contains a trailing newline. The
|
||||||
blank line terminating the headers is not contained in the list.
|
blank line terminating the headers is not contained in the list.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{fp}
|
\begin{memberdesc}[Message]{fp}
|
||||||
The file or file-like object passed at instantiation time. This can
|
The file or file-like object passed at instantiation time. This can
|
||||||
be used to read the message content.
|
be used to read the message content.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{unixfrom}
|
\begin{memberdesc}[Message]{unixfrom}
|
||||||
The \UNIX{} \samp{From~} line, if the message had one, or an empty
|
The \UNIX{} \samp{From~} line, if the message had one, or an empty
|
||||||
string. This is needed to regenerate the message in some contexts,
|
string. This is needed to regenerate the message in some contexts,
|
||||||
such as an \code{mbox}-style mailbox file.
|
such as an \code{mbox}-style mailbox file.
|
||||||
|
@ -293,34 +293,34 @@ such as an \code{mbox}-style mailbox file.
|
||||||
|
|
||||||
An \class{AddressList} instance has the following methods:
|
An \class{AddressList} instance has the following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{__len__}{}
|
\begin{methoddesc}[AddressList]{__len__}{}
|
||||||
Return the number of addresses in the address list.
|
Return the number of addresses in the address list.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{__str__}{}
|
\begin{methoddesc}[AddressList]{__str__}{}
|
||||||
Return a canonicalized string representation of the address list.
|
Return a canonicalized string representation of the address list.
|
||||||
Addresses are rendered in "name" <host@domain> form, comma-separated.
|
Addresses are rendered in "name" <host@domain> form, comma-separated.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{__add__}{alist}
|
\begin{methoddesc}[AddressList]{__add__}{alist}
|
||||||
Return a new \class{AddressList} instance that contains all addresses
|
Return a new \class{AddressList} instance that contains all addresses
|
||||||
in both \class{AddressList} operands, with duplicates removed (set
|
in both \class{AddressList} operands, with duplicates removed (set
|
||||||
union).
|
union).
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{__iadd__}{alist}
|
\begin{methoddesc}[AddressList]{__iadd__}{alist}
|
||||||
In-place version of \method{__add__()}; turns this \class{AddressList}
|
In-place version of \method{__add__()}; turns this \class{AddressList}
|
||||||
instance into the union of itself and the right-hand instance,
|
instance into the union of itself and the right-hand instance,
|
||||||
\var{alist}.
|
\var{alist}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{__sub__}{alist}
|
\begin{methoddesc}[AddressList]{__sub__}{alist}
|
||||||
Return a new \class{AddressList} instance that contains every address
|
Return a new \class{AddressList} instance that contains every address
|
||||||
in the left-hand \class{AddressList} operand that is not present in
|
in the left-hand \class{AddressList} operand that is not present in
|
||||||
the right-hand address operand (set difference).
|
the right-hand address operand (set difference).
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{__isub__}{alist}
|
\begin{methoddesc}[AddressList]{__isub__}{alist}
|
||||||
In-place version of \method{__sub__()}, removing addresses in this
|
In-place version of \method{__sub__()}, removing addresses in this
|
||||||
list which are also in \var{alist}.
|
list which are also in \var{alist}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
@ -328,7 +328,7 @@ list which are also in \var{alist}.
|
||||||
|
|
||||||
Finally, \class{AddressList} instances have one public instance variable:
|
Finally, \class{AddressList} instances have one public instance variable:
|
||||||
|
|
||||||
\begin{memberdesc}{addresslist}
|
\begin{memberdesc}[AddressList]{addresslist}
|
||||||
A list of tuple string pairs, one per address. In each member, the
|
A list of tuple string pairs, one per address. In each member, the
|
||||||
first is the canonicalized name part, the second is the
|
first is the canonicalized name part, the second is the
|
||||||
actual route-address (\character{@}-separated username-host.domain
|
actual route-address (\character{@}-separated username-host.domain
|
||||||
|
|
|
@ -48,7 +48,7 @@ From print_time 930343700.273
|
||||||
|
|
||||||
\class{scheduler} instances have the following methods:
|
\class{scheduler} instances have the following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{enterabs}{time, priority, action, argument}
|
\begin{methoddesc}[scheduler]{enterabs}{time, priority, action, argument}
|
||||||
Schedule a new event. The \var{time} argument should be a numeric type
|
Schedule a new event. The \var{time} argument should be a numeric type
|
||||||
compatible with the return value of the \var{timefunc} function passed
|
compatible with the return value of the \var{timefunc} function passed
|
||||||
to the constructor. Events scheduled for
|
to the constructor. Events scheduled for
|
||||||
|
@ -63,23 +63,23 @@ Return value is an event which may be used for later cancellation of
|
||||||
the event (see \method{cancel()}).
|
the event (see \method{cancel()}).
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{enter}{delay, priority, action, argument}
|
\begin{methoddesc}[scheduler]{enter}{delay, priority, action, argument}
|
||||||
Schedule an event for \var{delay} more time units. Other then the
|
Schedule an event for \var{delay} more time units. Other then the
|
||||||
relative time, the other arguments, the effect and the return value
|
relative time, the other arguments, the effect and the return value
|
||||||
are the same as those for \method{enterabs()}.
|
are the same as those for \method{enterabs()}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{cancel}{event}
|
\begin{methoddesc}[scheduler]{cancel}{event}
|
||||||
Remove the event from the queue. If \var{event} is not an event
|
Remove the event from the queue. If \var{event} is not an event
|
||||||
currently in the queue, this method will raise a
|
currently in the queue, this method will raise a
|
||||||
\exception{RuntimeError}.
|
\exception{RuntimeError}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{empty}{}
|
\begin{methoddesc}[scheduler]{empty}{}
|
||||||
Return true if the event queue is empty.
|
Return true if the event queue is empty.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{run}{}
|
\begin{methoddesc}[scheduler]{run}{}
|
||||||
Run all scheduled events. This function will wait
|
Run all scheduled events. This function will wait
|
||||||
(using the \function{delayfunc} function passed to the constructor)
|
(using the \function{delayfunc} function passed to the constructor)
|
||||||
for the next event, then execute it and so on until there are no more
|
for the next event, then execute it and so on until there are no more
|
||||||
|
|
|
@ -58,7 +58,7 @@ parsing rules. See section~\ref{shlex-objects}.
|
||||||
|
|
||||||
A \class{shlex} instance has the following methods:
|
A \class{shlex} instance has the following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{get_token}{}
|
\begin{methoddesc}[shlex]{get_token}{}
|
||||||
Return a token. If tokens have been stacked using
|
Return a token. If tokens have been stacked using
|
||||||
\method{push_token()}, pop a token off the stack. Otherwise, read one
|
\method{push_token()}, pop a token off the stack. Otherwise, read one
|
||||||
from the input stream. If reading encounters an immediate
|
from the input stream. If reading encounters an immediate
|
||||||
|
@ -66,17 +66,17 @@ end-of-file, \member{self.eof} is returned (the empty string (\code{''})
|
||||||
in non-\POSIX{} mode, and \code{None} in \POSIX{} mode).
|
in non-\POSIX{} mode, and \code{None} in \POSIX{} mode).
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{push_token}{str}
|
\begin{methoddesc}[shlex]{push_token}{str}
|
||||||
Push the argument onto the token stack.
|
Push the argument onto the token stack.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{read_token}{}
|
\begin{methoddesc}[shlex]{read_token}{}
|
||||||
Read a raw token. Ignore the pushback stack, and do not interpret source
|
Read a raw token. Ignore the pushback stack, and do not interpret source
|
||||||
requests. (This is not ordinarily a useful entry point, and is
|
requests. (This is not ordinarily a useful entry point, and is
|
||||||
documented here only for the sake of completeness.)
|
documented here only for the sake of completeness.)
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{sourcehook}{filename}
|
\begin{methoddesc}[shlex]{sourcehook}{filename}
|
||||||
When \class{shlex} detects a source request (see
|
When \class{shlex} detects a source request (see
|
||||||
\member{source} below) this method is given the following token as
|
\member{source} below) this method is given the following token as
|
||||||
argument, and expected to return a tuple consisting of a filename and
|
argument, and expected to return a tuple consisting of a filename and
|
||||||
|
@ -106,7 +106,7 @@ For more explicit control of source stacking, use the
|
||||||
\method{push_source()} and \method{pop_source()} methods.
|
\method{push_source()} and \method{pop_source()} methods.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{push_source}{stream\optional{, filename}}
|
\begin{methoddesc}[shlex]{push_source}{stream\optional{, filename}}
|
||||||
Push an input source stream onto the input stack. If the filename
|
Push an input source stream onto the input stack. If the filename
|
||||||
argument is specified it will later be available for use in error
|
argument is specified it will later be available for use in error
|
||||||
messages. This is the same method used internally by the
|
messages. This is the same method used internally by the
|
||||||
|
@ -114,14 +114,14 @@ messages. This is the same method used internally by the
|
||||||
\versionadded{2.1}
|
\versionadded{2.1}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{pop_source}{}
|
\begin{methoddesc}[shlex]{pop_source}{}
|
||||||
Pop the last-pushed input source from the input stack.
|
Pop the last-pushed input source from the input stack.
|
||||||
This is the same method used internally when the lexer reaches
|
This is the same method used internally when the lexer reaches
|
||||||
\EOF{} on a stacked input stream.
|
\EOF{} on a stacked input stream.
|
||||||
\versionadded{2.1}
|
\versionadded{2.1}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{error_leader}{\optional{file\optional{, line}}}
|
\begin{methoddesc}[shlex]{error_leader}{\optional{file\optional{, line}}}
|
||||||
This method generates an error message leader in the format of a
|
This method generates an error message leader in the format of a
|
||||||
\UNIX{} C compiler error label; the format is \code{'"\%s", line \%d: '},
|
\UNIX{} C compiler error label; the format is \code{'"\%s", line \%d: '},
|
||||||
where the \samp{\%s} is replaced with the name of the current source
|
where the \samp{\%s} is replaced with the name of the current source
|
||||||
|
@ -137,63 +137,63 @@ Instances of \class{shlex} subclasses have some public instance
|
||||||
variables which either control lexical analysis or can be used for
|
variables which either control lexical analysis or can be used for
|
||||||
debugging:
|
debugging:
|
||||||
|
|
||||||
\begin{memberdesc}{commenters}
|
\begin{memberdesc}[shlex]{commenters}
|
||||||
The string of characters that are recognized as comment beginners.
|
The string of characters that are recognized as comment beginners.
|
||||||
All characters from the comment beginner to end of line are ignored.
|
All characters from the comment beginner to end of line are ignored.
|
||||||
Includes just \character{\#} by default.
|
Includes just \character{\#} by default.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{wordchars}
|
\begin{memberdesc}[shlex]{wordchars}
|
||||||
The string of characters that will accumulate into multi-character
|
The string of characters that will accumulate into multi-character
|
||||||
tokens. By default, includes all \ASCII{} alphanumerics and
|
tokens. By default, includes all \ASCII{} alphanumerics and
|
||||||
underscore.
|
underscore.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{whitespace}
|
\begin{memberdesc}[shlex]{whitespace}
|
||||||
Characters that will be considered whitespace and skipped. Whitespace
|
Characters that will be considered whitespace and skipped. Whitespace
|
||||||
bounds tokens. By default, includes space, tab, linefeed and
|
bounds tokens. By default, includes space, tab, linefeed and
|
||||||
carriage-return.
|
carriage-return.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{escape}
|
\begin{memberdesc}[shlex]{escape}
|
||||||
Characters that will be considered as escape. This will be only used
|
Characters that will be considered as escape. This will be only used
|
||||||
in \POSIX{} mode, and includes just \character{\textbackslash} by default.
|
in \POSIX{} mode, and includes just \character{\textbackslash} by default.
|
||||||
\versionadded{2.3}
|
\versionadded{2.3}
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{quotes}
|
\begin{memberdesc}[shlex]{quotes}
|
||||||
Characters that will be considered string quotes. The token
|
Characters that will be considered string quotes. The token
|
||||||
accumulates until the same quote is encountered again (thus, different
|
accumulates until the same quote is encountered again (thus, different
|
||||||
quote types protect each other as in the shell.) By default, includes
|
quote types protect each other as in the shell.) By default, includes
|
||||||
\ASCII{} single and double quotes.
|
\ASCII{} single and double quotes.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{escapedquotes}
|
\begin{memberdesc}[shlex]{escapedquotes}
|
||||||
Characters in \member{quotes} that will interpret escape characters
|
Characters in \member{quotes} that will interpret escape characters
|
||||||
defined in \member{escape}. This is only used in \POSIX{} mode, and
|
defined in \member{escape}. This is only used in \POSIX{} mode, and
|
||||||
includes just \character{"} by default.
|
includes just \character{"} by default.
|
||||||
\versionadded{2.3}
|
\versionadded{2.3}
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{whitespace_split}
|
\begin{memberdesc}[shlex]{whitespace_split}
|
||||||
If \code{True}, tokens will only be split in whitespaces. This is useful, for
|
If \code{True}, tokens will only be split in whitespaces. This is useful, for
|
||||||
example, for parsing command lines with \class{shlex}, getting tokens
|
example, for parsing command lines with \class{shlex}, getting tokens
|
||||||
in a similar way to shell arguments.
|
in a similar way to shell arguments.
|
||||||
\versionadded{2.3}
|
\versionadded{2.3}
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{infile}
|
\begin{memberdesc}[shlex]{infile}
|
||||||
The name of the current input file, as initially set at class
|
The name of the current input file, as initially set at class
|
||||||
instantiation time or stacked by later source requests. It may
|
instantiation time or stacked by later source requests. It may
|
||||||
be useful to examine this when constructing error messages.
|
be useful to examine this when constructing error messages.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{instream}
|
\begin{memberdesc}[shlex]{instream}
|
||||||
The input stream from which this \class{shlex} instance is reading
|
The input stream from which this \class{shlex} instance is reading
|
||||||
characters.
|
characters.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{source}
|
\begin{memberdesc}[shlex]{source}
|
||||||
This member is \code{None} by default. If you assign a string to it,
|
This member is \code{None} by default. If you assign a string to it,
|
||||||
that string will be recognized as a lexical-level inclusion request
|
that string will be recognized as a lexical-level inclusion request
|
||||||
similar to the \samp{source} keyword in various shells. That is, the
|
similar to the \samp{source} keyword in various shells. That is, the
|
||||||
|
@ -204,23 +204,23 @@ become the original input stream. Source requests may be stacked any
|
||||||
number of levels deep.
|
number of levels deep.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{debug}
|
\begin{memberdesc}[shlex]{debug}
|
||||||
If this member is numeric and \code{1} or more, a \class{shlex}
|
If this member is numeric and \code{1} or more, a \class{shlex}
|
||||||
instance will print verbose progress output on its behavior. If you
|
instance will print verbose progress output on its behavior. If you
|
||||||
need to use this, you can read the module source code to learn the
|
need to use this, you can read the module source code to learn the
|
||||||
details.
|
details.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{lineno}
|
\begin{memberdesc}[shlex]{lineno}
|
||||||
Source line number (count of newlines seen so far plus one).
|
Source line number (count of newlines seen so far plus one).
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{token}
|
\begin{memberdesc}[shlex]{token}
|
||||||
The token buffer. It may be useful to examine this when catching
|
The token buffer. It may be useful to examine this when catching
|
||||||
exceptions.
|
exceptions.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{eof}
|
\begin{memberdesc}[shlex]{eof}
|
||||||
Token used to determine end of file. This will be set to the empty
|
Token used to determine end of file. This will be set to the empty
|
||||||
string (\code{''}), in non-\POSIX{} mode, and to \code{None} in
|
string (\code{''}), in non-\POSIX{} mode, and to \code{None} in
|
||||||
\POSIX{} mode.
|
\POSIX{} mode.
|
||||||
|
|
|
@ -108,13 +108,13 @@ simple, stand alone XML-RPC servers.
|
||||||
|
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{register_introspection_functions}{}
|
\begin{methoddesc}[SimpleXMLRPCServer]{register_introspection_functions}{}
|
||||||
Registers the XML-RPC introspection functions \code{system.listMethods},
|
Registers the XML-RPC introspection functions \code{system.listMethods},
|
||||||
\code{system.methodHelp} and \code{system.methodSignature}.
|
\code{system.methodHelp} and \code{system.methodSignature}.
|
||||||
\versionadded{2.3}
|
\versionadded{2.3}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{register_multicall_functions}{}
|
\begin{methoddesc}[SimpleXMLRPCServer]{register_multicall_functions}{}
|
||||||
Registers the XML-RPC multicall function system.multicall.
|
Registers the XML-RPC multicall function system.multicall.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ print s.system.listMethods()
|
||||||
The \class{CGIXMLRPCRequestHandler} class can be used to
|
The \class{CGIXMLRPCRequestHandler} class can be used to
|
||||||
handle XML-RPC requests sent to Python CGI scripts.
|
handle XML-RPC requests sent to Python CGI scripts.
|
||||||
|
|
||||||
\begin{methoddesc}{register_function}{function\optional{, name}}
|
\begin{methoddesc}[CGIXMLRPCRequestHandler]{register_function}{function\optional{, name}}
|
||||||
Register a function that can respond to XML-RPC requests. If
|
Register a function that can respond to XML-RPC requests. If
|
||||||
\var{name} is given, it will be the method name associated with
|
\var{name} is given, it will be the method name associated with
|
||||||
function, otherwise \var{function.__name__} will be used. \var{name}
|
function, otherwise \var{function.__name__} will be used. \var{name}
|
||||||
|
@ -187,7 +187,7 @@ characters not legal in Python identifiers, including the period
|
||||||
character.
|
character.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{register_instance}{instance}
|
\begin{methoddesc}[CGIXMLRPCRequestHandler]{register_instance}{instance}
|
||||||
Register an object which is used to expose method names
|
Register an object which is used to expose method names
|
||||||
which have not been registered using \method{register_function()}. If
|
which have not been registered using \method{register_function()}. If
|
||||||
instance contains a \method{_dispatch()} method, it is called with the
|
instance contains a \method{_dispatch()} method, it is called with the
|
||||||
|
@ -203,17 +203,17 @@ parameters from the request, and the return value is passed
|
||||||
back to the client.
|
back to the client.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{register_introspection_functions}{}
|
\begin{methoddesc}[CGIXMLRPCRequestHandler]{register_introspection_functions}{}
|
||||||
Register the XML-RPC introspection functions
|
Register the XML-RPC introspection functions
|
||||||
\code{system.listMethods}, \code{system.methodHelp} and
|
\code{system.listMethods}, \code{system.methodHelp} and
|
||||||
\code{system.methodSignature}.
|
\code{system.methodSignature}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{register_multicall_functions}{}
|
\begin{methoddesc}[CGIXMLRPCRequestHandler]{register_multicall_functions}{}
|
||||||
Register the XML-RPC multicall function \code{system.multicall}.
|
Register the XML-RPC multicall function \code{system.multicall}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{handle_request}{\optional{request_text = None}}
|
\begin{methoddesc}[CGIXMLRPCRequestHandler]{handle_request}{\optional{request_text = None}}
|
||||||
Handle a XML-RPC request. If \var{request_text} is given, it
|
Handle a XML-RPC request. If \var{request_text} is given, it
|
||||||
should be the POST data provided by the HTTP server,
|
should be the POST data provided by the HTTP server,
|
||||||
otherwise the contents of stdin will be used.
|
otherwise the contents of stdin will be used.
|
||||||
|
|
|
@ -126,13 +126,13 @@ A nice selection of exceptions is defined as well:
|
||||||
|
|
||||||
An \class{SMTP} instance has the following methods:
|
An \class{SMTP} instance has the following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{set_debuglevel}{level}
|
\begin{methoddesc}[SMTP]{set_debuglevel}{level}
|
||||||
Set the debug output level. A true value for \var{level} results in
|
Set the debug output level. A true value for \var{level} results in
|
||||||
debug messages for connection and for all messages sent to and
|
debug messages for connection and for all messages sent to and
|
||||||
received from the server.
|
received from the server.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{connect}{\optional{host\optional{, port}}}
|
\begin{methoddesc}[SMTP]{connect}{\optional{host\optional{, port}}}
|
||||||
Connect to a host on a given port. The defaults are to connect to the
|
Connect to a host on a given port. The defaults are to connect to the
|
||||||
local host at the standard SMTP port (25).
|
local host at the standard SMTP port (25).
|
||||||
If the hostname ends with a colon (\character{:}) followed by a
|
If the hostname ends with a colon (\character{:}) followed by a
|
||||||
|
@ -142,7 +142,7 @@ This method is automatically invoked by the constructor if a
|
||||||
host is specified during instantiation.
|
host is specified during instantiation.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{docmd}{cmd, \optional{, argstring}}
|
\begin{methoddesc}[SMTP]{docmd}{cmd, \optional{, argstring}}
|
||||||
Send a command \var{cmd} to the server. The optional argument
|
Send a command \var{cmd} to the server. The optional argument
|
||||||
\var{argstring} is simply concatenated to the command, separated by a
|
\var{argstring} is simply concatenated to the command, separated by a
|
||||||
space.
|
space.
|
||||||
|
@ -159,7 +159,7 @@ If the connection to the server is lost while waiting for the reply,
|
||||||
\exception{SMTPServerDisconnected} will be raised.
|
\exception{SMTPServerDisconnected} will be raised.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{helo}{\optional{hostname}}
|
\begin{methoddesc}[SMTP]{helo}{\optional{hostname}}
|
||||||
Identify yourself to the SMTP server using \samp{HELO}. The hostname
|
Identify yourself to the SMTP server using \samp{HELO}. The hostname
|
||||||
argument defaults to the fully qualified domain name of the local
|
argument defaults to the fully qualified domain name of the local
|
||||||
host.
|
host.
|
||||||
|
@ -169,7 +169,7 @@ explicitly. It will be implicitly called by the \method{sendmail()}
|
||||||
when necessary.
|
when necessary.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{ehlo}{\optional{hostname}}
|
\begin{methoddesc}[SMTP]{ehlo}{\optional{hostname}}
|
||||||
Identify yourself to an ESMTP server using \samp{EHLO}. The hostname
|
Identify yourself to an ESMTP server using \samp{EHLO}. The hostname
|
||||||
argument defaults to the fully qualified domain name of the local
|
argument defaults to the fully qualified domain name of the local
|
||||||
host. Examine the response for ESMTP option and store them for use by
|
host. Examine the response for ESMTP option and store them for use by
|
||||||
|
@ -180,13 +180,13 @@ mail, it should not be necessary to call this method explicitly. It
|
||||||
will be implicitly called by \method{sendmail()} when necessary.
|
will be implicitly called by \method{sendmail()} when necessary.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{has_extn}{name}
|
\begin{methoddesc}[SMTP]{has_extn}{name}
|
||||||
Return \constant{True} if \var{name} is in the set of SMTP service
|
Return \constant{True} if \var{name} is in the set of SMTP service
|
||||||
extensions returned by the server, \constant{False} otherwise.
|
extensions returned by the server, \constant{False} otherwise.
|
||||||
Case is ignored.
|
Case is ignored.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{verify}{address}
|
\begin{methoddesc}[SMTP]{verify}{address}
|
||||||
Check the validity of an address on this server using SMTP \samp{VRFY}.
|
Check the validity of an address on this server using SMTP \samp{VRFY}.
|
||||||
Returns a tuple consisting of code 250 and a full \rfc{822} address
|
Returns a tuple consisting of code 250 and a full \rfc{822} address
|
||||||
(including human name) if the user address is valid. Otherwise returns
|
(including human name) if the user address is valid. Otherwise returns
|
||||||
|
@ -195,7 +195,7 @@ an SMTP error code of 400 or greater and an error string.
|
||||||
\note{Many sites disable SMTP \samp{VRFY} in order to foil spammers.}
|
\note{Many sites disable SMTP \samp{VRFY} in order to foil spammers.}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{login}{user, password}
|
\begin{methoddesc}[SMTP]{login}{user, password}
|
||||||
Log in on an SMTP server that requires authentication.
|
Log in on an SMTP server that requires authentication.
|
||||||
The arguments are the username and the password to authenticate with.
|
The arguments are the username and the password to authenticate with.
|
||||||
If there has been no previous \samp{EHLO} or \samp{HELO} command this
|
If there has been no previous \samp{EHLO} or \samp{HELO} command this
|
||||||
|
@ -213,7 +213,7 @@ or may raise the following exceptions:
|
||||||
\end{description}
|
\end{description}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{starttls}{\optional{keyfile\optional{, certfile}}}
|
\begin{methoddesc}[SMTP]{starttls}{\optional{keyfile\optional{, certfile}}}
|
||||||
Put the SMTP connection in TLS (Transport Layer Security) mode. All
|
Put the SMTP connection in TLS (Transport Layer Security) mode. All
|
||||||
SMTP commands that follow will be encrypted. You should then call
|
SMTP commands that follow will be encrypted. You should then call
|
||||||
\method{ehlo()} again.
|
\method{ehlo()} again.
|
||||||
|
@ -222,8 +222,8 @@ If \var{keyfile} and \var{certfile} are provided, these are passed to
|
||||||
the \refmodule{socket} module's \function{ssl()} function.
|
the \refmodule{socket} module's \function{ssl()} function.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{sendmail}{from_addr, to_addrs, msg\optional{,
|
\begin{methoddesc}[SMTP]{sendmail}{from_addr, to_addrs, msg\optional{,
|
||||||
mail_options, rcpt_options}}
|
mail_options, rcpt_options}}
|
||||||
Send mail. The required arguments are an \rfc{822} from-address
|
Send mail. The required arguments are an \rfc{822} from-address
|
||||||
string, a list of \rfc{822} to-address strings (a bare string will be
|
string, a list of \rfc{822} to-address strings (a bare string will be
|
||||||
treated as a list with 1 address), and a message string. The caller
|
treated as a list with 1 address), and a message string. The caller
|
||||||
|
@ -279,7 +279,7 @@ an exception is raised.
|
||||||
|
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{quit}{}
|
\begin{methoddesc}[SMTP]{quit}{}
|
||||||
Terminate the SMTP session and close the connection.
|
Terminate the SMTP session and close the connection.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
|
|
|
@ -176,16 +176,16 @@ metacharacters, can safely be passed to child processes.
|
||||||
|
|
||||||
Instances of the \class{Popen} class have the following methods:
|
Instances of the \class{Popen} class have the following methods:
|
||||||
|
|
||||||
\begin{methoddesc}{poll}{}
|
\begin{methoddesc}[Popen]{poll}{}
|
||||||
Check if child process has terminated. Returns returncode
|
Check if child process has terminated. Returns returncode
|
||||||
attribute.
|
attribute.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{wait}{}
|
\begin{methoddesc}[Popen]{wait}{}
|
||||||
Wait for child process to terminate. Returns returncode attribute.
|
Wait for child process to terminate. Returns returncode attribute.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{communicate}{input=None}
|
\begin{methoddesc}[Popen]{communicate}{input=None}
|
||||||
Interact with process: Send data to stdin. Read data from stdout and
|
Interact with process: Send data to stdin. Read data from stdout and
|
||||||
stderr, until end-of-file is reached. Wait for process to terminate.
|
stderr, until end-of-file is reached. Wait for process to terminate.
|
||||||
The optional \var{input} argument should be a string to be sent to the
|
The optional \var{input} argument should be a string to be sent to the
|
||||||
|
@ -199,29 +199,29 @@ if the data size is large or unlimited.}
|
||||||
|
|
||||||
The following attributes are also available:
|
The following attributes are also available:
|
||||||
|
|
||||||
\begin{memberdesc}{stdin}
|
\begin{memberdesc}[Popen]{stdin}
|
||||||
If the \var{stdin} argument is \code{PIPE}, this attribute is a file
|
If the \var{stdin} argument is \code{PIPE}, this attribute is a file
|
||||||
object that provides input to the child process. Otherwise, it is
|
object that provides input to the child process. Otherwise, it is
|
||||||
\code{None}.
|
\code{None}.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{stdout}
|
\begin{memberdesc}[Popen]{stdout}
|
||||||
If the \var{stdout} argument is \code{PIPE}, this attribute is a file
|
If the \var{stdout} argument is \code{PIPE}, this attribute is a file
|
||||||
object that provides output from the child process. Otherwise, it is
|
object that provides output from the child process. Otherwise, it is
|
||||||
\code{None}.
|
\code{None}.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{stderr}
|
\begin{memberdesc}[Popen]{stderr}
|
||||||
If the \var{stderr} argument is \code{PIPE}, this attribute is file
|
If the \var{stderr} argument is \code{PIPE}, this attribute is file
|
||||||
object that provides error output from the child process. Otherwise,
|
object that provides error output from the child process. Otherwise,
|
||||||
it is \code{None}.
|
it is \code{None}.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{pid}
|
\begin{memberdesc}[Popen]{pid}
|
||||||
The process ID of the child process.
|
The process ID of the child process.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{returncode}
|
\begin{memberdesc}[Popen]{returncode}
|
||||||
The child return code. A \code{None} value indicates that the process
|
The child return code. A \code{None} value indicates that the process
|
||||||
hasn't terminated yet. A negative value -N indicates that the child
|
hasn't terminated yet. A negative value -N indicates that the child
|
||||||
was terminated by signal N (\UNIX{} only).
|
was terminated by signal N (\UNIX{} only).
|
||||||
|
|
|
@ -55,7 +55,7 @@ individual descriptions below.
|
||||||
\class{Telnet} instances have the following methods:
|
\class{Telnet} instances have the following methods:
|
||||||
|
|
||||||
|
|
||||||
\begin{methoddesc}{read_until}{expected\optional{, timeout}}
|
\begin{methoddesc}[Telnet]{read_until}{expected\optional{, timeout}}
|
||||||
Read until a given string, \var{expected}, is encountered or until
|
Read until a given string, \var{expected}, is encountered or until
|
||||||
\var{timeout} seconds have passed.
|
\var{timeout} seconds have passed.
|
||||||
|
|
||||||
|
@ -64,17 +64,17 @@ possibly the empty string. Raise \exception{EOFError} if the connection
|
||||||
is closed and no cooked data is available.
|
is closed and no cooked data is available.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{read_all}{}
|
\begin{methoddesc}[Telnet]{read_all}{}
|
||||||
Read all data until \EOF; block until connection closed.
|
Read all data until \EOF; block until connection closed.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{read_some}{}
|
\begin{methoddesc}[Telnet]{read_some}{}
|
||||||
Read at least one byte of cooked data unless \EOF{} is hit.
|
Read at least one byte of cooked data unless \EOF{} is hit.
|
||||||
Return \code{''} if \EOF{} is hit. Block if no data is immediately
|
Return \code{''} if \EOF{} is hit. Block if no data is immediately
|
||||||
available.
|
available.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{read_very_eager}{}
|
\begin{methoddesc}[Telnet]{read_very_eager}{}
|
||||||
Read everything that can be without blocking in I/O (eager).
|
Read everything that can be without blocking in I/O (eager).
|
||||||
|
|
||||||
Raise \exception{EOFError} if connection closed and no cooked data
|
Raise \exception{EOFError} if connection closed and no cooked data
|
||||||
|
@ -82,7 +82,7 @@ available. Return \code{''} if no cooked data available otherwise.
|
||||||
Do not block unless in the midst of an IAC sequence.
|
Do not block unless in the midst of an IAC sequence.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{read_eager}{}
|
\begin{methoddesc}[Telnet]{read_eager}{}
|
||||||
Read readily available data.
|
Read readily available data.
|
||||||
|
|
||||||
Raise \exception{EOFError} if connection closed and no cooked data
|
Raise \exception{EOFError} if connection closed and no cooked data
|
||||||
|
@ -90,7 +90,7 @@ available. Return \code{''} if no cooked data available otherwise.
|
||||||
Do not block unless in the midst of an IAC sequence.
|
Do not block unless in the midst of an IAC sequence.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{read_lazy}{}
|
\begin{methoddesc}[Telnet]{read_lazy}{}
|
||||||
Process and return data already in the queues (lazy).
|
Process and return data already in the queues (lazy).
|
||||||
|
|
||||||
Raise \exception{EOFError} if connection closed and no data available.
|
Raise \exception{EOFError} if connection closed and no data available.
|
||||||
|
@ -98,7 +98,7 @@ Return \code{''} if no cooked data available otherwise. Do not block
|
||||||
unless in the midst of an IAC sequence.
|
unless in the midst of an IAC sequence.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{read_very_lazy}{}
|
\begin{methoddesc}[Telnet]{read_very_lazy}{}
|
||||||
Return any data available in the cooked queue (very lazy).
|
Return any data available in the cooked queue (very lazy).
|
||||||
|
|
||||||
Raise \exception{EOFError} if connection closed and no data available.
|
Raise \exception{EOFError} if connection closed and no data available.
|
||||||
|
@ -106,7 +106,7 @@ Return \code{''} if no cooked data available otherwise. This method
|
||||||
never blocks.
|
never blocks.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{read_sb_data}{}
|
\begin{methoddesc}[Telnet]{read_sb_data}{}
|
||||||
Return the data collected between a SB/SE pair (suboption begin/end).
|
Return the data collected between a SB/SE pair (suboption begin/end).
|
||||||
The callback should access these data when it was invoked with a
|
The callback should access these data when it was invoked with a
|
||||||
\code{SE} command. This method never blocks.
|
\code{SE} command. This method never blocks.
|
||||||
|
@ -114,7 +114,7 @@ The callback should access these data when it was invoked with a
|
||||||
\versionadded{2.3}
|
\versionadded{2.3}
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{open}{host\optional{, port\optional{, timeout}}}
|
\begin{methoddesc}[Telnet]{open}{host\optional{, port\optional{, timeout}}}
|
||||||
Connect to a host.
|
Connect to a host.
|
||||||
The optional second argument is the port number, which
|
The optional second argument is the port number, which
|
||||||
defaults to the standard Telnet port (23).
|
defaults to the standard Telnet port (23).
|
||||||
|
@ -125,44 +125,44 @@ timeout setting will be used).
|
||||||
Do not try to reopen an already connected instance.
|
Do not try to reopen an already connected instance.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{msg}{msg\optional{, *args}}
|
\begin{methoddesc}[Telnet]{msg}{msg\optional{, *args}}
|
||||||
Print a debug message when the debug level is \code{>} 0.
|
Print a debug message when the debug level is \code{>} 0.
|
||||||
If extra arguments are present, they are substituted in the
|
If extra arguments are present, they are substituted in the
|
||||||
message using the standard string formatting operator.
|
message using the standard string formatting operator.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{set_debuglevel}{debuglevel}
|
\begin{methoddesc}[Telnet]{set_debuglevel}{debuglevel}
|
||||||
Set the debug level. The higher the value of \var{debuglevel}, the
|
Set the debug level. The higher the value of \var{debuglevel}, the
|
||||||
more debug output you get (on \code{sys.stdout}).
|
more debug output you get (on \code{sys.stdout}).
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{close}{}
|
\begin{methoddesc}[Telnet]{close}{}
|
||||||
Close the connection.
|
Close the connection.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{get_socket}{}
|
\begin{methoddesc}[Telnet]{get_socket}{}
|
||||||
Return the socket object used internally.
|
Return the socket object used internally.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{fileno}{}
|
\begin{methoddesc}[Telnet]{fileno}{}
|
||||||
Return the file descriptor of the socket object used internally.
|
Return the file descriptor of the socket object used internally.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{write}{buffer}
|
\begin{methoddesc}[Telnet]{write}{buffer}
|
||||||
Write a string to the socket, doubling any IAC characters.
|
Write a string to the socket, doubling any IAC characters.
|
||||||
This can block if the connection is blocked. May raise
|
This can block if the connection is blocked. May raise
|
||||||
\exception{socket.error} if the connection is closed.
|
\exception{socket.error} if the connection is closed.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{interact}{}
|
\begin{methoddesc}[Telnet]{interact}{}
|
||||||
Interaction function, emulates a very dumb Telnet client.
|
Interaction function, emulates a very dumb Telnet client.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{mt_interact}{}
|
\begin{methoddesc}[Telnet]{mt_interact}{}
|
||||||
Multithreaded version of \method{interact()}.
|
Multithreaded version of \method{interact()}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{expect}{list\optional{, timeout}}
|
\begin{methoddesc}[Telnet]{expect}{list\optional{, timeout}}
|
||||||
Read until one from a list of a regular expressions matches.
|
Read until one from a list of a regular expressions matches.
|
||||||
|
|
||||||
The first argument is a list of regular expressions, either
|
The first argument is a list of regular expressions, either
|
||||||
|
@ -184,7 +184,7 @@ or if more than one expression can match the same input, the
|
||||||
results are indeterministic, and may depend on the I/O timing.
|
results are indeterministic, and may depend on the I/O timing.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{set_option_negotiation_callback}{callback}
|
\begin{methoddesc}[Telnet]{set_option_negotiation_callback}{callback}
|
||||||
Each time a telnet option is read on the input flow, this
|
Each time a telnet option is read on the input flow, this
|
||||||
\var{callback} (if set) is called with the following parameters :
|
\var{callback} (if set) is called with the following parameters :
|
||||||
callback(telnet socket, command (DO/DONT/WILL/WONT), option). No other
|
callback(telnet socket, command (DO/DONT/WILL/WONT), option). No other
|
||||||
|
|
|
@ -20,11 +20,11 @@ returned count is equal to the length of the list returned by
|
||||||
\function{enumerate()}.
|
\function{enumerate()}.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{Condition}{}
|
\begin{funcdescni}{Condition}{}
|
||||||
A factory function that returns a new condition variable object.
|
A factory function that returns a new condition variable object.
|
||||||
A condition variable allows one or more threads to wait until they
|
A condition variable allows one or more threads to wait until they
|
||||||
are notified by another thread.
|
are notified by another thread.
|
||||||
\end{funcdesc}
|
\end{funcdescni}
|
||||||
|
|
||||||
\begin{funcdesc}{currentThread}{}
|
\begin{funcdesc}{currentThread}{}
|
||||||
Return the current \class{Thread} object, corresponding to the
|
Return the current \class{Thread} object, corresponding to the
|
||||||
|
@ -41,12 +41,12 @@ includes daemonic threads, dummy thread objects created by
|
||||||
terminated threads and threads that have not yet been started.
|
terminated threads and threads that have not yet been started.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{Event}{}
|
\begin{funcdescni}{Event}{}
|
||||||
A factory function that returns a new event object. An event manages
|
A factory function that returns a new event object. An event manages
|
||||||
a flag that can be set to true with the \method{set()} method and
|
a flag that can be set to true with the \method{set()} method and
|
||||||
reset to false with the \method{clear()} method. The \method{wait()}
|
reset to false with the \method{clear()} method. The \method{wait()}
|
||||||
method blocks until the flag is true.
|
method blocks until the flag is true.
|
||||||
\end{funcdesc}
|
\end{funcdescni}
|
||||||
|
|
||||||
\begin{classdesc*}{local}{}
|
\begin{classdesc*}{local}{}
|
||||||
A class that represents thread-local data. Thread-local data are data
|
A class that represents thread-local data. Thread-local data are data
|
||||||
|
@ -81,14 +81,14 @@ acquire it again without blocking; the thread must release it once
|
||||||
for each time it has acquired it.
|
for each time it has acquired it.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{Semaphore}{\optional{value}}
|
\begin{funcdescni}{Semaphore}{\optional{value}}
|
||||||
A factory function that returns a new semaphore object. A
|
A factory function that returns a new semaphore object. A
|
||||||
semaphore manages a counter representing the number of \method{release()}
|
semaphore manages a counter representing the number of \method{release()}
|
||||||
calls minus the number of \method{acquire()} calls, plus an initial value.
|
calls minus the number of \method{acquire()} calls, plus an initial value.
|
||||||
The \method{acquire()} method blocks if necessary until it can return
|
The \method{acquire()} method blocks if necessary until it can return
|
||||||
without making the counter negative. If not given, \var{value} defaults to
|
without making the counter negative. If not given, \var{value} defaults to
|
||||||
1.
|
1.
|
||||||
\end{funcdesc}
|
\end{funcdescni}
|
||||||
|
|
||||||
\begin{funcdesc}{BoundedSemaphore}{\optional{value}}
|
\begin{funcdesc}{BoundedSemaphore}{\optional{value}}
|
||||||
A factory function that returns a new bounded semaphore object. A bounded
|
A factory function that returns a new bounded semaphore object. A bounded
|
||||||
|
@ -99,12 +99,12 @@ semaphore is released too many times it's a sign of a bug. If not given,
|
||||||
\var{value} defaults to 1.
|
\var{value} defaults to 1.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{classdesc*}{Thread}{}
|
\begin{classdesc*}{Thread}
|
||||||
A class that represents a thread of control. This class can be safely
|
A class that represents a thread of control. This class can be safely
|
||||||
subclassed in a limited fashion.
|
subclassed in a limited fashion.
|
||||||
\end{classdesc*}
|
\end{classdesc*}
|
||||||
|
|
||||||
\begin{classdesc*}{Timer}{}
|
\begin{classdesc*}{Timer}
|
||||||
A thread that executes a function after a specified interval has passed.
|
A thread that executes a function after a specified interval has passed.
|
||||||
\end{classdesc*}
|
\end{classdesc*}
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ and may vary across implementations.
|
||||||
|
|
||||||
All methods are executed atomically.
|
All methods are executed atomically.
|
||||||
|
|
||||||
\begin{methoddesc}{acquire}{\optional{blocking\code{ = 1}}}
|
\begin{methoddesc}[Lock]{acquire}{\optional{blocking\code{ = 1}}}
|
||||||
Acquire a lock, blocking or non-blocking.
|
Acquire a lock, blocking or non-blocking.
|
||||||
|
|
||||||
When invoked without arguments, block until the lock is
|
When invoked without arguments, block until the lock is
|
||||||
|
@ -197,7 +197,7 @@ immediately; otherwise, do the same thing as when called
|
||||||
without arguments, and return true.
|
without arguments, and return true.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{release}{}
|
\begin{methoddesc}[Lock]{release}{}
|
||||||
Release a lock.
|
Release a lock.
|
||||||
|
|
||||||
When the lock is locked, reset it to unlocked, and return. If
|
When the lock is locked, reset it to unlocked, and return. If
|
||||||
|
@ -227,7 +227,7 @@ the final \method{release()} (the \method{release()} of the outermost
|
||||||
pair) resets the lock to unlocked and allows another thread blocked in
|
pair) resets the lock to unlocked and allows another thread blocked in
|
||||||
\method{acquire()} to proceed.
|
\method{acquire()} to proceed.
|
||||||
|
|
||||||
\begin{methoddesc}{acquire}{\optional{blocking\code{ = 1}}}
|
\begin{methoddesc}[RLock]{acquire}{\optional{blocking\code{ = 1}}}
|
||||||
Acquire a lock, blocking or non-blocking.
|
Acquire a lock, blocking or non-blocking.
|
||||||
|
|
||||||
When invoked without arguments: if this thread already owns
|
When invoked without arguments: if this thread already owns
|
||||||
|
@ -249,7 +249,7 @@ immediately; otherwise, do the same thing as when called
|
||||||
without arguments, and return true.
|
without arguments, and return true.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{release}{}
|
\begin{methoddesc}[RLock]{release}{}
|
||||||
Release a lock, decrementing the recursion level. If after the
|
Release a lock, decrementing the recursion level. If after the
|
||||||
decrement it is zero, reset the lock to unlocked (not owned by any
|
decrement it is zero, reset the lock to unlocked (not owned by any
|
||||||
thread), and if any other threads are blocked waiting for the lock to
|
thread), and if any other threads are blocked waiting for the lock to
|
||||||
|
|
|
@ -261,7 +261,7 @@ The only method which is more powerful as a method is
|
||||||
\function{degrees()}, which takes an optional argument letting
|
\function{degrees()}, which takes an optional argument letting
|
||||||
you specify the number of units corresponding to a full circle:
|
you specify the number of units corresponding to a full circle:
|
||||||
|
|
||||||
\begin{methoddesc}{degrees}{\optional{fullcircle}}
|
\begin{methoddesc}[Turtle]{degrees}{\optional{fullcircle}}
|
||||||
\var{fullcircle} is by default 360. This can cause the pen to have any
|
\var{fullcircle} is by default 360. This can cause the pen to have any
|
||||||
angular units whatever: give \var{fullcircle} 2*$\pi$ for radians, or
|
angular units whatever: give \var{fullcircle} 2*$\pi$ for radians, or
|
||||||
400 for gradians.
|
400 for gradians.
|
||||||
|
|
|
@ -619,14 +619,14 @@ The test code can use any of the following methods to check for and
|
||||||
report failures.
|
report failures.
|
||||||
|
|
||||||
\begin{methoddesc}[TestCase]{assert_}{expr\optional{, msg}}
|
\begin{methoddesc}[TestCase]{assert_}{expr\optional{, msg}}
|
||||||
\methodline{failUnless}{expr\optional{, msg}}
|
\methodline[TestCase]{failUnless}{expr\optional{, msg}}
|
||||||
Signal a test failure if \var{expr} is false; the explanation for
|
Signal a test failure if \var{expr} is false; the explanation for
|
||||||
the error will be \var{msg} if given, otherwise it will be
|
the error will be \var{msg} if given, otherwise it will be
|
||||||
\constant{None}.
|
\constant{None}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}[TestCase]{assertEqual}{first, second\optional{, msg}}
|
\begin{methoddesc}[TestCase]{assertEqual}{first, second\optional{, msg}}
|
||||||
\methodline{failUnlessEqual}{first, second\optional{, msg}}
|
\methodline[TestCase]{failUnlessEqual}{first, second\optional{, msg}}
|
||||||
Test that \var{first} and \var{second} are equal. If the values do
|
Test that \var{first} and \var{second} are equal. If the values do
|
||||||
not compare equal, the test will fail with the explanation given by
|
not compare equal, the test will fail with the explanation given by
|
||||||
\var{msg}, or \constant{None}. Note that using \method{failUnlessEqual()}
|
\var{msg}, or \constant{None}. Note that using \method{failUnlessEqual()}
|
||||||
|
@ -637,7 +637,7 @@ report failures.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}[TestCase]{assertNotEqual}{first, second\optional{, msg}}
|
\begin{methoddesc}[TestCase]{assertNotEqual}{first, second\optional{, msg}}
|
||||||
\methodline{failIfEqual}{first, second\optional{, msg}}
|
\methodline[TestCase]{failIfEqual}{first, second\optional{, msg}}
|
||||||
Test that \var{first} and \var{second} are not equal. If the values
|
Test that \var{first} and \var{second} are not equal. If the values
|
||||||
do compare equal, the test will fail with the explanation given by
|
do compare equal, the test will fail with the explanation given by
|
||||||
\var{msg}, or \constant{None}. Note that using \method{failIfEqual()}
|
\var{msg}, or \constant{None}. Note that using \method{failIfEqual()}
|
||||||
|
@ -649,7 +649,7 @@ report failures.
|
||||||
|
|
||||||
\begin{methoddesc}[TestCase]{assertAlmostEqual}{first, second\optional{,
|
\begin{methoddesc}[TestCase]{assertAlmostEqual}{first, second\optional{,
|
||||||
places\optional{, msg}}}
|
places\optional{, msg}}}
|
||||||
\methodline{failUnlessAlmostEqual}{first, second\optional{,
|
\methodline[TestCase]{failUnlessAlmostEqual}{first, second\optional{,
|
||||||
places\optional{, msg}}}
|
places\optional{, msg}}}
|
||||||
Test that \var{first} and \var{second} are approximately equal
|
Test that \var{first} and \var{second} are approximately equal
|
||||||
by computing the difference, rounding to the given number of \var{places},
|
by computing the difference, rounding to the given number of \var{places},
|
||||||
|
@ -661,7 +661,7 @@ report failures.
|
||||||
|
|
||||||
\begin{methoddesc}[TestCase]{assertNotAlmostEqual}{first, second\optional{,
|
\begin{methoddesc}[TestCase]{assertNotAlmostEqual}{first, second\optional{,
|
||||||
places\optional{, msg}}}
|
places\optional{, msg}}}
|
||||||
\methodline{failIfAlmostEqual}{first, second\optional{,
|
\methodline[TestCase]{failIfAlmostEqual}{first, second\optional{,
|
||||||
places\optional{, msg}}}
|
places\optional{, msg}}}
|
||||||
Test that \var{first} and \var{second} are not approximately equal
|
Test that \var{first} and \var{second} are not approximately equal
|
||||||
by computing the difference, rounding to the given number of \var{places},
|
by computing the difference, rounding to the given number of \var{places},
|
||||||
|
@ -672,7 +672,7 @@ report failures.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}[TestCase]{assertRaises}{exception, callable, \moreargs}
|
\begin{methoddesc}[TestCase]{assertRaises}{exception, callable, \moreargs}
|
||||||
\methodline{failUnlessRaises}{exception, callable, \moreargs}
|
\methodline[TestCase]{failUnlessRaises}{exception, callable, \moreargs}
|
||||||
Test that an exception is raised when \var{callable} is called with
|
Test that an exception is raised when \var{callable} is called with
|
||||||
any positional or keyword arguments that are also passed to
|
any positional or keyword arguments that are also passed to
|
||||||
\method{assertRaises()}. The test passes if \var{exception} is
|
\method{assertRaises()}. The test passes if \var{exception} is
|
||||||
|
|
|
@ -588,7 +588,7 @@ The same as \method{http_error_301()}, but called for the
|
||||||
|
|
||||||
\class{HTTPCookieProcessor} instances have one attribute:
|
\class{HTTPCookieProcessor} instances have one attribute:
|
||||||
|
|
||||||
\begin{memberdesc}{cookiejar}
|
\begin{memberdesc}[HTTPCookieProcessor]{cookiejar}
|
||||||
The \class{cookielib.CookieJar} in which cookies are stored.
|
The \class{cookielib.CookieJar} in which cookies are stored.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
|
|
|
@ -134,12 +134,12 @@ may be either returned data in a conformant type or a \class{Fault} or
|
||||||
Servers that support the XML introspection API support some common
|
Servers that support the XML introspection API support some common
|
||||||
methods grouped under the reserved \member{system} member:
|
methods grouped under the reserved \member{system} member:
|
||||||
|
|
||||||
\begin{methoddesc}{system.listMethods}{}
|
\begin{methoddesc}[ServerProxy]{system.listMethods}{}
|
||||||
This method returns a list of strings, one for each (non-system)
|
This method returns a list of strings, one for each (non-system)
|
||||||
method supported by the XML-RPC server.
|
method supported by the XML-RPC server.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{system.methodSignature}{name}
|
\begin{methoddesc}[ServerProxy]{system.methodSignature}{name}
|
||||||
This method takes one parameter, the name of a method implemented by
|
This method takes one parameter, the name of a method implemented by
|
||||||
the XML-RPC server.It returns an array of possible signatures for this
|
the XML-RPC server.It returns an array of possible signatures for this
|
||||||
method. A signature is an array of types. The first of these types is
|
method. A signature is an array of types. The first of these types is
|
||||||
|
@ -159,7 +159,7 @@ returned. In Python this means that the type of the returned
|
||||||
value will be something other that list.
|
value will be something other that list.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{system.methodHelp}{name}
|
\begin{methoddesc}[ServerProxy]{system.methodHelp}{name}
|
||||||
This method takes one parameter, the name of a method implemented by
|
This method takes one parameter, the name of a method implemented by
|
||||||
the XML-RPC server. It returns a documentation string describing the
|
the XML-RPC server. It returns a documentation string describing the
|
||||||
use of that method. If no such string is available, an empty string is
|
use of that method. If no such string is available, an empty string is
|
||||||
|
@ -184,7 +184,7 @@ implemented in the obvious ways.
|
||||||
It also has the following method, supported mainly for internal use by
|
It also has the following method, supported mainly for internal use by
|
||||||
the unmarshalling code:
|
the unmarshalling code:
|
||||||
|
|
||||||
\begin{methoddesc}{encode}{out}
|
\begin{methoddesc}[Boolean]{encode}{out}
|
||||||
Write the XML-RPC encoding of this Boolean item to the out stream object.
|
Write the XML-RPC encoding of this Boolean item to the out stream object.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
|
@ -197,11 +197,11 @@ ISO 8601 time/date string, or a {}\class{\refmodule{datetime}.datetime},
|
||||||
instance. It has the following methods, supported mainly for internal use
|
instance. It has the following methods, supported mainly for internal use
|
||||||
by the marshalling/unmarshalling code:
|
by the marshalling/unmarshalling code:
|
||||||
|
|
||||||
\begin{methoddesc}{decode}{string}
|
\begin{methoddesc}[DateTime]{decode}{string}
|
||||||
Accept a string as the instance's new time value.
|
Accept a string as the instance's new time value.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{encode}{out}
|
\begin{methoddesc}[DateTime]{encode}{out}
|
||||||
Write the XML-RPC encoding of this \class{DateTime} item to the
|
Write the XML-RPC encoding of this \class{DateTime} item to the
|
||||||
\var{out} stream object.
|
\var{out} stream object.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
@ -242,11 +242,11 @@ It also supports certain of Python's built-in operators through a
|
||||||
A \class{Fault} object encapsulates the content of an XML-RPC fault tag.
|
A \class{Fault} object encapsulates the content of an XML-RPC fault tag.
|
||||||
Fault objects have the following members:
|
Fault objects have the following members:
|
||||||
|
|
||||||
\begin{memberdesc}{faultCode}
|
\begin{memberdesc}[Fault]{faultCode}
|
||||||
A string indicating the fault type.
|
A string indicating the fault type.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{faultString}
|
\begin{memberdesc}[Fault]{faultString}
|
||||||
A string containing a diagnostic message associated with the fault.
|
A string containing a diagnostic message associated with the fault.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
|
@ -258,19 +258,19 @@ underlying transport layer (such as a 404 `not found' error if the
|
||||||
server named by the URI does not exist). It has the following
|
server named by the URI does not exist). It has the following
|
||||||
members:
|
members:
|
||||||
|
|
||||||
\begin{memberdesc}{url}
|
\begin{memberdesc}[ProtocolError]{url}
|
||||||
The URI or URL that triggered the error.
|
The URI or URL that triggered the error.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{errcode}
|
\begin{memberdesc}[ProtocolError]{errcode}
|
||||||
The error code.
|
The error code.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{errmsg}
|
\begin{memberdesc}[ProtocolError]{errmsg}
|
||||||
The error message or diagnostic string.
|
The error message or diagnostic string.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{headers}
|
\begin{memberdesc}[ProtocolError]{headers}
|
||||||
A string containing the headers of the HTTP/HTTPS request that
|
A string containing the headers of the HTTP/HTTPS request that
|
||||||
triggered the error.
|
triggered the error.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
|
@ -68,14 +68,14 @@ Besides the dictionary interface, \class{IC} objects have the
|
||||||
following methods:
|
following methods:
|
||||||
|
|
||||||
|
|
||||||
\begin{methoddesc}{launchurl}{url\optional{, hint}}
|
\begin{methoddesc}[IC]{launchurl}{url\optional{, hint}}
|
||||||
Parse the given URL, launch the correct application and pass it the
|
Parse the given URL, launch the correct application and pass it the
|
||||||
URL. The optional \var{hint} can be a scheme name such as
|
URL. The optional \var{hint} can be a scheme name such as
|
||||||
\code{'mailto:'}, in which case incomplete URLs are completed with this
|
\code{'mailto:'}, in which case incomplete URLs are completed with this
|
||||||
scheme. If \var{hint} is not provided, incomplete URLs are invalid.
|
scheme. If \var{hint} is not provided, incomplete URLs are invalid.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{parseurl}{data\optional{, start\optional{, end\optional{, hint}}}}
|
\begin{methoddesc}[IC]{parseurl}{data\optional{, start\optional{, end\optional{, hint}}}}
|
||||||
Find an URL somewhere in \var{data} and return start position, end
|
Find an URL somewhere in \var{data} and return start position, end
|
||||||
position and the URL. The optional \var{start} and \var{end} can be
|
position and the URL. The optional \var{start} and \var{end} can be
|
||||||
used to limit the search, so for instance if a user clicks in a long
|
used to limit the search, so for instance if a user clicks in a long
|
||||||
|
@ -85,7 +85,7 @@ user clicked. As above, \var{hint} is an optional scheme used to
|
||||||
complete incomplete URLs.
|
complete incomplete URLs.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{mapfile}{file}
|
\begin{methoddesc}[IC]{mapfile}{file}
|
||||||
Return the mapping entry for the given \var{file}, which can be passed
|
Return the mapping entry for the given \var{file}, which can be passed
|
||||||
as either a filename or an \function{FSSpec()} result, and which
|
as either a filename or an \function{FSSpec()} result, and which
|
||||||
need not exist.
|
need not exist.
|
||||||
|
@ -106,7 +106,7 @@ postprocessing application, \var{mimetype} is the MIME type of this
|
||||||
file and \var{entryname} is the name of this entry.
|
file and \var{entryname} is the name of this entry.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{maptypecreator}{type, creator\optional{, filename}}
|
\begin{methoddesc}[IC]{maptypecreator}{type, creator\optional{, filename}}
|
||||||
Return the mapping entry for files with given 4-character \var{type} and
|
Return the mapping entry for files with given 4-character \var{type} and
|
||||||
\var{creator} codes. The optional \var{filename} may be specified to
|
\var{creator} codes. The optional \var{filename} may be specified to
|
||||||
further help finding the correct entry (if the creator code is
|
further help finding the correct entry (if the creator code is
|
||||||
|
@ -115,7 +115,7 @@ further help finding the correct entry (if the creator code is
|
||||||
The mapping entry is returned in the same format as for \var{mapfile}.
|
The mapping entry is returned in the same format as for \var{mapfile}.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{methoddesc}{settypecreator}{file}
|
\begin{methoddesc}[IC]{settypecreator}{file}
|
||||||
Given an existing \var{file}, specified either as a filename or as an
|
Given an existing \var{file}, specified either as a filename or as an
|
||||||
\function{FSSpec()} result, set its creator and type correctly based
|
\function{FSSpec()} result, set its creator and type correctly based
|
||||||
on its extension. The finder is told about the change, so the finder
|
on its extension. The finder is told about the change, so the finder
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue