Documentation/Source/eric4.Helpviewer.Passwords.PasswordManager.html

changeset 3
0d9daebf5b8c
equal deleted inserted replaced
2:bc6196164237 3:0d9daebf5b8c
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
3 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
4 <html><head>
5 <title>eric4.Helpviewer.Passwords.PasswordManager</title>
6 <style>
7 body {
8 background:white;
9 margin: 0em 1em 10em 1em;
10 color: black;
11 }
12
13 h1 { color: white; background: #4FA4FF; }
14 h2 { color: white; background: #4FA4FF; }
15 h3 { color: white; background: #00557F; }
16 h4 { color: white; background: #00557F; }
17
18 a { color: #AA5500; }
19
20 </style>
21 </head>
22 <body><a NAME="top" ID="top"></a>
23 <h1>eric4.Helpviewer.Passwords.PasswordManager</h1>
24 <p>
25 Module implementing the password manager.
26 </p>
27 <h3>Global Attributes</h3>
28 <table>
29 <tr><td>None</td></tr>
30 </table>
31 <h3>Classes</h3>
32 <table>
33 <tr>
34 <td><a href="#LoginForm">LoginForm</a></td>
35 <td>Class implementing a data structure for login forms.</td>
36 </tr><tr>
37 <td><a href="#PasswordManager">PasswordManager</a></td>
38 <td>Class implementing the password manager.</td>
39 </tr>
40 </table>
41 <h3>Functions</h3>
42 <table>
43 <tr><td>None</td></tr>
44 </table>
45 <hr /><hr />
46 <a NAME="LoginForm" ID="LoginForm"></a>
47 <h2>LoginForm</h2>
48 <p>
49 Class implementing a data structure for login forms.
50 </p>
51 <h3>Derived from</h3>
52 object
53 <h3>Class Attributes</h3>
54 <table>
55 <tr><td>None</td></tr>
56 </table>
57 <h3>Methods</h3>
58 <table>
59 <tr>
60 <td><a href="#LoginForm.__init__">LoginForm</a></td>
61 <td>Constructor</td>
62 </tr><tr>
63 <td><a href="#LoginForm.isValid">isValid</a></td>
64 <td>Public method to test for validity.</td>
65 </tr><tr>
66 <td><a href="#LoginForm.load">load</a></td>
67 <td>Public method to load the form data from a file.</td>
68 </tr><tr>
69 <td><a href="#LoginForm.save">save</a></td>
70 <td>Public method to save the form data to a file.</td>
71 </tr>
72 </table>
73 <a NAME="LoginForm.__init__" ID="LoginForm.__init__"></a>
74 <h4>LoginForm (Constructor)</h4>
75 <b>LoginForm</b>(<i></i>)
76 <p>
77 Constructor
78 </p><a NAME="LoginForm.isValid" ID="LoginForm.isValid"></a>
79 <h4>LoginForm.isValid</h4>
80 <b>isValid</b>(<i></i>)
81 <p>
82 Public method to test for validity.
83 </p><dl>
84 <dt>Returns:</dt>
85 <dd>
86 flag indicating a valid form (boolean)
87 </dd>
88 </dl><a NAME="LoginForm.load" ID="LoginForm.load"></a>
89 <h4>LoginForm.load</h4>
90 <b>load</b>(<i>data</i>)
91 <p>
92 Public method to load the form data from a file.
93 </p><dl>
94 <dt><i>data</i></dt>
95 <dd>
96 list of strings to load data from (list of strings)
97 </dd>
98 </dl><dl>
99 <dt>Returns:</dt>
100 <dd>
101 flag indicating success (boolean)
102 </dd>
103 </dl><a NAME="LoginForm.save" ID="LoginForm.save"></a>
104 <h4>LoginForm.save</h4>
105 <b>save</b>(<i>f</i>)
106 <p>
107 Public method to save the form data to a file.
108 </p><dl>
109 <dt><i>f</i></dt>
110 <dd>
111 file or file like object open for writing
112 </dd>
113 </dl><dl>
114 <dt>Returns:</dt>
115 <dd>
116 flag indicating success (booelan)
117 </dd>
118 </dl>
119 <div align="right"><a href="#top">Up</a></div>
120 <hr /><hr />
121 <a NAME="PasswordManager" ID="PasswordManager"></a>
122 <h2>PasswordManager</h2>
123 <p>
124 Class implementing the password manager.
125 </p><h4>Signals</h4>
126 <dl>
127 <dt>changed()</dt>
128 <dd>
129 emitted to indicate a change
130 </dd>
131 </dl>
132 <h3>Derived from</h3>
133 QObject
134 <h3>Class Attributes</h3>
135 <table>
136 <tr><td>FORMS</td></tr><tr><td>NEVER</td></tr><tr><td>SEPARATOR</td></tr>
137 </table>
138 <h3>Methods</h3>
139 <table>
140 <tr>
141 <td><a href="#PasswordManager.__init__">PasswordManager</a></td>
142 <td>Constructor</td>
143 </tr><tr>
144 <td><a href="#PasswordManager.__createKey">__createKey</a></td>
145 <td>Private method to create the key string for the login credentials.</td>
146 </tr><tr>
147 <td><a href="#PasswordManager.__extractMultipartQueryItems">__extractMultipartQueryItems</a></td>
148 <td>Private method to extract the query items for a post operation.</td>
149 </tr><tr>
150 <td><a href="#PasswordManager.__findForm">__findForm</a></td>
151 <td>Private method to find the form used for logging in.</td>
152 </tr><tr>
153 <td><a href="#PasswordManager.__load">__load</a></td>
154 <td>Private method to load the saved login credentials.</td>
155 </tr><tr>
156 <td><a href="#PasswordManager.__stripUrl">__stripUrl</a></td>
157 <td>Private method to strip off all unneeded parts of a URL.</td>
158 </tr><tr>
159 <td><a href="#PasswordManager.allSiteNames">allSiteNames</a></td>
160 <td>Public method to get a list of all site names.</td>
161 </tr><tr>
162 <td><a href="#PasswordManager.clear">clear</a></td>
163 <td>Public slot to clear the saved passwords.</td>
164 </tr><tr>
165 <td><a href="#PasswordManager.close">close</a></td>
166 <td>Public method to close the open search engines manager.</td>
167 </tr><tr>
168 <td><a href="#PasswordManager.fill">fill</a></td>
169 <td>Public slot to fill login forms with saved data.</td>
170 </tr><tr>
171 <td><a href="#PasswordManager.getLogin">getLogin</a></td>
172 <td>Public method to get the login credentials.</td>
173 </tr><tr>
174 <td><a href="#PasswordManager.post">post</a></td>
175 <td>Public method to check, if the data to be sent contains login data.</td>
176 </tr><tr>
177 <td><a href="#PasswordManager.removePassword">removePassword</a></td>
178 <td>Public method to remove a password entry.</td>
179 </tr><tr>
180 <td><a href="#PasswordManager.save">save</a></td>
181 <td>Public slot to save the login entries to disk.</td>
182 </tr><tr>
183 <td><a href="#PasswordManager.setLogin">setLogin</a></td>
184 <td>Public method to set the login credentials.</td>
185 </tr><tr>
186 <td><a href="#PasswordManager.siteInfo">siteInfo</a></td>
187 <td>Public method to get a reference to the named site.</td>
188 </tr><tr>
189 <td><a href="#PasswordManager.sitesCount">sitesCount</a></td>
190 <td>Public method to get the number of available sites.</td>
191 </tr>
192 </table>
193 <a NAME="PasswordManager.__init__" ID="PasswordManager.__init__"></a>
194 <h4>PasswordManager (Constructor)</h4>
195 <b>PasswordManager</b>(<i>parent = None</i>)
196 <p>
197 Constructor
198 </p><dl>
199 <dt><i>parent</i></dt>
200 <dd>
201 reference to the parent object (QObject)
202 </dd>
203 </dl><a NAME="PasswordManager.__createKey" ID="PasswordManager.__createKey"></a>
204 <h4>PasswordManager.__createKey</h4>
205 <b>__createKey</b>(<i>url, realm</i>)
206 <p>
207 Private method to create the key string for the login credentials.
208 </p><dl>
209 <dt><i>url</i></dt>
210 <dd>
211 URL to get the credentials for (QUrl)
212 </dd><dt><i>realm</i></dt>
213 <dd>
214 realm to get the credentials for (string)
215 </dd>
216 </dl><dl>
217 <dt>Returns:</dt>
218 <dd>
219 key string (string)
220 </dd>
221 </dl><a NAME="PasswordManager.__extractMultipartQueryItems" ID="PasswordManager.__extractMultipartQueryItems"></a>
222 <h4>PasswordManager.__extractMultipartQueryItems</h4>
223 <b>__extractMultipartQueryItems</b>(<i>data, boundary</i>)
224 <p>
225 Private method to extract the query items for a post operation.
226 </p><dl>
227 <dt><i>data</i></dt>
228 <dd>
229 data to be sent (QByteArray)
230 </dd><dt><i>boundary</i></dt>
231 <dd>
232 boundary string (QByteArray)
233 </dd>
234 </dl><dl>
235 <dt>Returns:</dt>
236 <dd>
237 set of name, value pairs (set of tuple of string, string)
238 </dd>
239 </dl><a NAME="PasswordManager.__findForm" ID="PasswordManager.__findForm"></a>
240 <h4>PasswordManager.__findForm</h4>
241 <b>__findForm</b>(<i>webPage, data, boundary = None</i>)
242 <p>
243 Private method to find the form used for logging in.
244 </p><dl>
245 <dt><i>webPage</i></dt>
246 <dd>
247 reference to the web page (QWebPage)
248 </dd><dt><i>data</i></dt>
249 <dd>
250 data to be sent (QByteArray)
251 </dd><dt><i>boundary=</i></dt>
252 <dd>
253 boundary string (QByteArray) for multipart encoded data,
254 None for urlencoded data
255 </dd>
256 </dl><dl>
257 <dt>Returns:</dt>
258 <dd>
259 parsed form (LoginForm)
260 </dd>
261 </dl><a NAME="PasswordManager.__load" ID="PasswordManager.__load"></a>
262 <h4>PasswordManager.__load</h4>
263 <b>__load</b>(<i></i>)
264 <p>
265 Private method to load the saved login credentials.
266 </p><a NAME="PasswordManager.__stripUrl" ID="PasswordManager.__stripUrl"></a>
267 <h4>PasswordManager.__stripUrl</h4>
268 <b>__stripUrl</b>(<i>url</i>)
269 <p>
270 Private method to strip off all unneeded parts of a URL.
271 </p><dl>
272 <dt><i>url</i></dt>
273 <dd>
274 URL to be stripped (QUrl)
275 </dd>
276 </dl><dl>
277 <dt>Returns:</dt>
278 <dd>
279 stripped URL (QUrl)
280 </dd>
281 </dl><a NAME="PasswordManager.allSiteNames" ID="PasswordManager.allSiteNames"></a>
282 <h4>PasswordManager.allSiteNames</h4>
283 <b>allSiteNames</b>(<i></i>)
284 <p>
285 Public method to get a list of all site names.
286 </p><dl>
287 <dt>Returns:</dt>
288 <dd>
289 sorted list of all site names (list of strings)
290 </dd>
291 </dl><a NAME="PasswordManager.clear" ID="PasswordManager.clear"></a>
292 <h4>PasswordManager.clear</h4>
293 <b>clear</b>(<i></i>)
294 <p>
295 Public slot to clear the saved passwords.
296 </p><a NAME="PasswordManager.close" ID="PasswordManager.close"></a>
297 <h4>PasswordManager.close</h4>
298 <b>close</b>(<i></i>)
299 <p>
300 Public method to close the open search engines manager.
301 </p><a NAME="PasswordManager.fill" ID="PasswordManager.fill"></a>
302 <h4>PasswordManager.fill</h4>
303 <b>fill</b>(<i>page</i>)
304 <p>
305 Public slot to fill login forms with saved data.
306 </p><dl>
307 <dt><i>page</i></dt>
308 <dd>
309 reference to the web page (QWebPage)
310 </dd>
311 </dl><a NAME="PasswordManager.getLogin" ID="PasswordManager.getLogin"></a>
312 <h4>PasswordManager.getLogin</h4>
313 <b>getLogin</b>(<i>url, realm</i>)
314 <p>
315 Public method to get the login credentials.
316 </p><dl>
317 <dt><i>url</i></dt>
318 <dd>
319 URL to get the credentials for (QUrl)
320 </dd><dt><i>realm</i></dt>
321 <dd>
322 realm to get the credentials for (string)
323 </dd>
324 </dl><dl>
325 <dt>Returns:</dt>
326 <dd>
327 tuple containing the user name (string) and password (string)
328 </dd>
329 </dl><a NAME="PasswordManager.post" ID="PasswordManager.post"></a>
330 <h4>PasswordManager.post</h4>
331 <b>post</b>(<i>request, data</i>)
332 <p>
333 Public method to check, if the data to be sent contains login data.
334 </p><dl>
335 <dt><i>request</i></dt>
336 <dd>
337 reference to the network request (QNetworkRequest)
338 </dd><dt><i>data</i></dt>
339 <dd>
340 data to be sent (QByteArray)
341 </dd>
342 </dl><a NAME="PasswordManager.removePassword" ID="PasswordManager.removePassword"></a>
343 <h4>PasswordManager.removePassword</h4>
344 <b>removePassword</b>(<i>site</i>)
345 <p>
346 Public method to remove a password entry.
347 </p><dl>
348 <dt><i>site</i></dt>
349 <dd>
350 web site name (string)
351 </dd>
352 </dl><a NAME="PasswordManager.save" ID="PasswordManager.save"></a>
353 <h4>PasswordManager.save</h4>
354 <b>save</b>(<i></i>)
355 <p>
356 Public slot to save the login entries to disk.
357 </p><a NAME="PasswordManager.setLogin" ID="PasswordManager.setLogin"></a>
358 <h4>PasswordManager.setLogin</h4>
359 <b>setLogin</b>(<i>url, realm, username, password</i>)
360 <p>
361 Public method to set the login credentials.
362 </p><dl>
363 <dt><i>url</i></dt>
364 <dd>
365 URL to set the credentials for (QUrl)
366 </dd><dt><i>realm</i></dt>
367 <dd>
368 realm to set the credentials for (string)
369 </dd><dt><i>username</i></dt>
370 <dd>
371 username for the login (string)
372 </dd><dt><i>password</i></dt>
373 <dd>
374 password for the login (string)
375 </dd>
376 </dl><a NAME="PasswordManager.siteInfo" ID="PasswordManager.siteInfo"></a>
377 <h4>PasswordManager.siteInfo</h4>
378 <b>siteInfo</b>(<i>site</i>)
379 <p>
380 Public method to get a reference to the named site.
381 </p><dl>
382 <dt><i>site</i></dt>
383 <dd>
384 web site name (string)
385 </dd>
386 </dl><dl>
387 <dt>Returns:</dt>
388 <dd>
389 tuple containing the user name (string) and password (string)
390 </dd>
391 </dl><a NAME="PasswordManager.sitesCount" ID="PasswordManager.sitesCount"></a>
392 <h4>PasswordManager.sitesCount</h4>
393 <b>sitesCount</b>(<i></i>)
394 <p>
395 Public method to get the number of available sites.
396 </p><dl>
397 <dt>Returns:</dt>
398 <dd>
399 number of sites (integer)
400 </dd>
401 </dl>
402 <div align="right"><a href="#top">Up</a></div>
403 <hr />
404 </body></html>

eric ide

mercurial