diff options
author | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-03 11:25:13 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-03 11:25:13 +0000 |
commit | 458120dd40db6b4df55a4e96b650e16798ef06a0 (patch) | |
tree | 8f82685be24fef97e715c6f5ca4c68d34d5074ee /sys/src/cmd/python/Doc/lib/libnetrc.tex | |
parent | 3a742c699f6806c1145aea5149bf15de15a0afd7 (diff) |
add hg and python
Diffstat (limited to 'sys/src/cmd/python/Doc/lib/libnetrc.tex')
-rw-r--r-- | sys/src/cmd/python/Doc/lib/libnetrc.tex | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/sys/src/cmd/python/Doc/lib/libnetrc.tex b/sys/src/cmd/python/Doc/lib/libnetrc.tex new file mode 100644 index 000000000..f2a0c1cf3 --- /dev/null +++ b/sys/src/cmd/python/Doc/lib/libnetrc.tex @@ -0,0 +1,68 @@ +\section{\module{netrc} --- + netrc file processing} + +\declaremodule{standard}{netrc} +% Note the \protect needed for \file... ;-( +\modulesynopsis{Loading of \protect\file{.netrc} files.} +\moduleauthor{Eric S. Raymond}{esr@snark.thyrsus.com} +\sectionauthor{Eric S. Raymond}{esr@snark.thyrsus.com} + + +\versionadded{1.5.2} + +The \class{netrc} class parses and encapsulates the netrc file format +used by the \UNIX{} \program{ftp} program and other FTP clients. + +\begin{classdesc}{netrc}{\optional{file}} +A \class{netrc} instance or subclass instance encapsulates data from +a netrc file. The initialization argument, if present, specifies the +file to parse. If no argument is given, the file \file{.netrc} in the +user's home directory will be read. Parse errors will raise +\exception{NetrcParseError} with diagnostic information including the +file name, line number, and terminating token. +\end{classdesc} + +\begin{excdesc}{NetrcParseError} +Exception raised by the \class{netrc} class when syntactical errors +are encountered in source text. Instances of this exception provide +three interesting attributes: \member{msg} is a textual explanation +of the error, \member{filename} is the name of the source file, and +\member{lineno} gives the line number on which the error was found. +\end{excdesc} + + +\subsection{netrc Objects \label{netrc-objects}} + +A \class{netrc} instance has the following methods: + +\begin{methoddesc}{authenticators}{host} +Return a 3-tuple \code{(\var{login}, \var{account}, \var{password})} +of authenticators for \var{host}. If the netrc file did not +contain an entry for the given host, return the tuple associated with +the `default' entry. If neither matching host nor default entry is +available, return \code{None}. +\end{methoddesc} + +\begin{methoddesc}{__repr__}{} +Dump the class data as a string in the format of a netrc file. +(This discards comments and may reorder the entries.) +\end{methoddesc} + +Instances of \class{netrc} have public instance variables: + +\begin{memberdesc}{hosts} +Dictionary mapping host names to \code{(\var{login}, \var{account}, +\var{password})} tuples. The `default' entry, if any, is represented +as a pseudo-host by that name. +\end{memberdesc} + +\begin{memberdesc}{macros} +Dictionary mapping macro names to string lists. +\end{memberdesc} + +\note{Passwords are limited to a subset of the ASCII character set. +Versions of this module prior to 2.3 were extremely limited. Starting with +2.3, all ASCII punctuation is allowed in passwords. However, note that +whitespace and non-printable characters are not allowed in passwords. This +is a limitation of the way the .netrc file is parsed and may be removed in +the future.} |