Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | <html> | |
3 | <head> | |
4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> | |
5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> | |
6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> | |
7 | <link rel="first" href="lib.html" title='Python Library Reference' /> | |
8 | <link rel='contents' href='contents.html' title="Contents" /> | |
9 | <link rel='index' href='genindex.html' title='Index' /> | |
10 | <link rel='last' href='about.html' title='About this document...' /> | |
11 | <link rel='help' href='about.html' title='About this document...' /> | |
12 | <link rel="next" href="module-robotparser.html" /> | |
13 | <link rel="prev" href="module-xdrlib.html" /> | |
14 | <link rel="parent" href="netdata.html" /> | |
15 | <link rel="next" href="netrc-objects.html" /> | |
16 | <meta name='aesop' content='information' /> | |
17 | <title>12.18 netrc -- netrc file processing</title> | |
18 | </head> | |
19 | <body> | |
20 | <DIV CLASS="navigation"> | |
21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> | |
22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
23 | <tr> | |
24 | <td class='online-navigation'><a rel="prev" title="12.17.3 Exceptions" | |
25 | href="xdr-exceptions.html"><img src='../icons/previous.png' | |
26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
27 | <td class='online-navigation'><a rel="parent" title="12. Internet Data Handling" | |
28 | href="netdata.html"><img src='../icons/up.png' | |
29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
30 | <td class='online-navigation'><a rel="next" title="12.18.1 netrc Objects" | |
31 | href="netrc-objects.html"><img src='../icons/next.png' | |
32 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
33 | <td align="center" width="100%">Python Library Reference</td> | |
34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
35 | href="contents.html"><img src='../icons/contents.png' | |
36 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
37 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
38 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
39 | <td class='online-navigation'><a rel="index" title="Index" | |
40 | href="genindex.html"><img src='../icons/index.png' | |
41 | border='0' height='32' alt='Index' width='32' /></A></td> | |
42 | </tr></table> | |
43 | <div class='online-navigation'> | |
44 | <b class="navlabel">Previous:</b> | |
45 | <a class="sectref" rel="prev" href="xdr-exceptions.html">12.17.3 Exceptions</A> | |
46 | <b class="navlabel">Up:</b> | |
47 | <a class="sectref" rel="parent" href="netdata.html">12. Internet Data Handling</A> | |
48 | <b class="navlabel">Next:</b> | |
49 | <a class="sectref" rel="next" href="netrc-objects.html">12.18.1 netrc Objects</A> | |
50 | </div> | |
51 | <hr /></div> | |
52 | </DIV> | |
53 | <!--End of Navigation Panel--> | |
54 | ||
55 | <H1><A NAME="SECTION00141800000000000000000"> | |
56 | 12.18 <tt class="module">netrc</tt> -- | |
57 | netrc file processing</A> | |
58 | </H1> | |
59 | ||
60 | <P> | |
61 | <A NAME="module-netrc"></A> | |
62 | ||
63 | <P> | |
64 | ||
65 | <span class="versionnote">New in version 1.5.2.</span> | |
66 | ||
67 | <P> | |
68 | The <tt class="class">netrc</tt> class parses and encapsulates the netrc file format | |
69 | used by the <span class="Unix">Unix</span> <b class="program">ftp</b> program and other FTP clients. | |
70 | ||
71 | <P> | |
72 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
73 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-4195' xml:id='l2h-4195' class="class">netrc</tt></b>(</nobr></td> | |
74 | <td><var></var><big>[</big><var>file</var><big>]</big><var></var>)</td></tr></table></dt> | |
75 | <dd> | |
76 | A <tt class="class">netrc</tt> instance or subclass instance encapsulates data from | |
77 | a netrc file. The initialization argument, if present, specifies the | |
78 | file to parse. If no argument is given, the file <span class="file">.netrc</span> in the | |
79 | user's home directory will be read. Parse errors will raise | |
80 | <tt class="exception">NetrcParseError</tt> with diagnostic information including the | |
81 | file name, line number, and terminating token. | |
82 | </dl> | |
83 | ||
84 | <P> | |
85 | <dl><dt><b><span class="typelabel">exception</span> <tt id='l2h-4196' xml:id='l2h-4196' class="exception">NetrcParseError</tt></b></dt> | |
86 | <dd> | |
87 | Exception raised by the <tt class="class">netrc</tt> class when syntactical errors | |
88 | are encountered in source text. Instances of this exception provide | |
89 | three interesting attributes: <tt class="member">msg</tt> is a textual explanation | |
90 | of the error, <tt class="member">filename</tt> is the name of the source file, and | |
91 | <tt class="member">lineno</tt> gives the line number on which the error was found. | |
92 | </dd></dl> | |
93 | ||
94 | <P> | |
95 | ||
96 | <p><br /></p><hr class='online-navigation' /> | |
97 | <div class='online-navigation'> | |
98 | <!--Table of Child-Links--> | |
99 | <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></a> | |
100 | ||
101 | <UL CLASS="ChildLinks"> | |
102 | <LI><A href="netrc-objects.html">12.18.1 netrc Objects</a> | |
103 | </ul> | |
104 | <!--End of Table of Child-Links--> | |
105 | </div> | |
106 | ||
107 | <DIV CLASS="navigation"> | |
108 | <div class='online-navigation'> | |
109 | <p></p><hr /> | |
110 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
111 | <tr> | |
112 | <td class='online-navigation'><a rel="prev" title="12.17.3 Exceptions" | |
113 | href="xdr-exceptions.html"><img src='../icons/previous.png' | |
114 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
115 | <td class='online-navigation'><a rel="parent" title="12. Internet Data Handling" | |
116 | href="netdata.html"><img src='../icons/up.png' | |
117 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
118 | <td class='online-navigation'><a rel="next" title="12.18.1 netrc Objects" | |
119 | href="netrc-objects.html"><img src='../icons/next.png' | |
120 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
121 | <td align="center" width="100%">Python Library Reference</td> | |
122 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
123 | href="contents.html"><img src='../icons/contents.png' | |
124 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
125 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
126 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
127 | <td class='online-navigation'><a rel="index" title="Index" | |
128 | href="genindex.html"><img src='../icons/index.png' | |
129 | border='0' height='32' alt='Index' width='32' /></A></td> | |
130 | </tr></table> | |
131 | <div class='online-navigation'> | |
132 | <b class="navlabel">Previous:</b> | |
133 | <a class="sectref" rel="prev" href="xdr-exceptions.html">12.17.3 Exceptions</A> | |
134 | <b class="navlabel">Up:</b> | |
135 | <a class="sectref" rel="parent" href="netdata.html">12. Internet Data Handling</A> | |
136 | <b class="navlabel">Next:</b> | |
137 | <a class="sectref" rel="next" href="netrc-objects.html">12.18.1 netrc Objects</A> | |
138 | </div> | |
139 | </div> | |
140 | <hr /> | |
141 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> | |
142 | </DIV> | |
143 | <!--End of Navigation Panel--> | |
144 | <ADDRESS> | |
145 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. | |
146 | </ADDRESS> | |
147 | </BODY> | |
148 | </HTML> |