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="node88.html" /> | |
13 | <link rel="prev" href="module-zipimport.html" /> | |
14 | <link rel="parent" href="module-zipimport.html" /> | |
15 | <link rel="next" href="node88.html" /> | |
16 | <meta name='aesop' content='information' /> | |
17 | <title>3.22.1 zipimporter Objects </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="3.22 zipimport " | |
25 | href="module-zipimport.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="3.22 zipimport " | |
28 | href="module-zipimport.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="3.22.2 Examples" | |
31 | href="node88.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="module-zipimport.html">3.22 zipimport </A> | |
46 | <b class="navlabel">Up:</b> | |
47 | <a class="sectref" rel="parent" href="module-zipimport.html">3.22 zipimport </A> | |
48 | <b class="navlabel">Next:</b> | |
49 | <a class="sectref" rel="next" href="node88.html">3.22.2 Examples</A> | |
50 | </div> | |
51 | <hr /></div> | |
52 | </DIV> | |
53 | <!--End of Navigation Panel--> | |
54 | ||
55 | <H2><A NAME="SECTION0052210000000000000000"></A><A NAME="zipimporter-objects"></A> | |
56 | <BR> | |
57 | 3.22.1 zipimporter Objects | |
58 | </H2> | |
59 | ||
60 | <P> | |
61 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
62 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-728' xml:id='l2h-728' class="class">zipimporter</tt></b>(</nobr></td> | |
63 | <td><var>archivepath</var>)</td></tr></table></dt> | |
64 | <dd> \r | |
65 | Create a new zipimporter instance. <var>archivepath</var> must be a path to\r | |
66 | a zipfile. <tt class="class">ZipImportError</tt> is raised if <var>archivepath</var> doesn't\r | |
67 | point to a valid ZIP archive.\r | |
68 | </dl> | |
69 | ||
70 | <P> | |
71 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
72 | <td><nobr><b><tt id='l2h-729' xml:id='l2h-729' class="method">find_module</tt></b>(</nobr></td> | |
73 | <td><var>fullname</var><big>[</big><var>, path</var><big>]</big><var></var>)</td></tr></table></dt> | |
74 | <dd>\r | |
75 | Search for a module specified by <var>fullname</var>. <var>fullname</var> must be\r | |
76 | the fully qualified (dotted) module name. It returns the zipimporter\r | |
77 | instance itself if the module was found, or <tt class="constant">None</tt> if it wasn't.\r | |
78 | The optional <var>path</var> argument is ignored--it's there for \r | |
79 | compatibility with the importer protocol.\r | |
80 | </dl> | |
81 | ||
82 | <P> | |
83 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
84 | <td><nobr><b><tt id='l2h-730' xml:id='l2h-730' class="method">get_code</tt></b>(</nobr></td> | |
85 | <td><var>fullname</var>)</td></tr></table></dt> | |
86 | <dd>\r | |
87 | Return the code object for the specified module. Raise\r | |
88 | <tt class="class">ZipImportError</tt> if the module couldn't be found.\r | |
89 | </dl> | |
90 | ||
91 | <P> | |
92 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
93 | <td><nobr><b><tt id='l2h-731' xml:id='l2h-731' class="method">get_data</tt></b>(</nobr></td> | |
94 | <td><var>pathname</var>)</td></tr></table></dt> | |
95 | <dd>\r | |
96 | Return the data associated with <var>pathname</var>. Raise <tt class="exception">IOError</tt>\r | |
97 | if the file wasn't found.\r | |
98 | </dl> | |
99 | ||
100 | <P> | |
101 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
102 | <td><nobr><b><tt id='l2h-732' xml:id='l2h-732' class="method">get_source</tt></b>(</nobr></td> | |
103 | <td><var>fullname</var>)</td></tr></table></dt> | |
104 | <dd>\r | |
105 | Return the source code for the specified module. Raise\r | |
106 | <tt class="class">ZipImportError</tt> if the module couldn't be found, return\r | |
107 | <tt class="constant">None</tt> if the archive does contain the module, but has\r | |
108 | no source for it.\r | |
109 | </dl> | |
110 | ||
111 | <P> | |
112 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
113 | <td><nobr><b><tt id='l2h-733' xml:id='l2h-733' class="method">is_package</tt></b>(</nobr></td> | |
114 | <td><var>fullname</var>)</td></tr></table></dt> | |
115 | <dd>\r | |
116 | Return True if the module specified by <var>fullname</var> is a package.\r | |
117 | Raise <tt class="class">ZipImportError</tt> if the module couldn't be found.\r | |
118 | </dl> | |
119 | ||
120 | <P> | |
121 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
122 | <td><nobr><b><tt id='l2h-734' xml:id='l2h-734' class="method">load_module</tt></b>(</nobr></td> | |
123 | <td><var>fullname</var>)</td></tr></table></dt> | |
124 | <dd>\r | |
125 | Load the module specified by <var>fullname</var>. <var>fullname</var> must be the\r | |
126 | fully qualified (dotted) module name. It returns the imported\r | |
127 | module, or raises <tt class="class">ZipImportError</tt> if it wasn't found.\r | |
128 | </dl> | |
129 | ||
130 | <P> | |
131 | ||
132 | <DIV CLASS="navigation"> | |
133 | <div class='online-navigation'> | |
134 | <p></p><hr /> | |
135 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
136 | <tr> | |
137 | <td class='online-navigation'><a rel="prev" title="3.22 zipimport " | |
138 | href="module-zipimport.html"><img src='../icons/previous.png' | |
139 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
140 | <td class='online-navigation'><a rel="parent" title="3.22 zipimport " | |
141 | href="module-zipimport.html"><img src='../icons/up.png' | |
142 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
143 | <td class='online-navigation'><a rel="next" title="3.22.2 Examples" | |
144 | href="node88.html"><img src='../icons/next.png' | |
145 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
146 | <td align="center" width="100%">Python Library Reference</td> | |
147 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
148 | href="contents.html"><img src='../icons/contents.png' | |
149 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
150 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
151 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
152 | <td class='online-navigation'><a rel="index" title="Index" | |
153 | href="genindex.html"><img src='../icons/index.png' | |
154 | border='0' height='32' alt='Index' width='32' /></A></td> | |
155 | </tr></table> | |
156 | <div class='online-navigation'> | |
157 | <b class="navlabel">Previous:</b> | |
158 | <a class="sectref" rel="prev" href="module-zipimport.html">3.22 zipimport </A> | |
159 | <b class="navlabel">Up:</b> | |
160 | <a class="sectref" rel="parent" href="module-zipimport.html">3.22 zipimport </A> | |
161 | <b class="navlabel">Next:</b> | |
162 | <a class="sectref" rel="next" href="node88.html">3.22.2 Examples</A> | |
163 | </div> | |
164 | </div> | |
165 | <hr /> | |
166 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> | |
167 | </DIV> | |
168 | <!--End of Navigation Panel--> | |
169 | <ADDRESS> | |
170 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. | |
171 | </ADDRESS> | |
172 | </BODY> | |
173 | </HTML> |