Sat, 03 Mar 2012 17:42:42 +0100
Changed file format for saved login data to XML.
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> <html><head> <title>eric5.Helpviewer.Passwords.PasswordManager</title> <style> body { background: #EDECE6; margin: 0em 1em 10em 1em; color: black; } h1 { color: white; background: #85774A; } h2 { color: white; background: #85774A; } h3 { color: white; background: #9D936E; } h4 { color: white; background: #9D936E; } a { color: #BA6D36; } </style> </head> <body><a NAME="top" ID="top"></a> <h1>eric5.Helpviewer.Passwords.PasswordManager</h1> <p> Module implementing the password manager. </p> <h3>Global Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Classes</h3> <table> <tr> <td><a href="#PasswordManager">PasswordManager</a></td> <td>Class implementing the password manager.</td> </tr> </table> <h3>Functions</h3> <table> <tr><td>None</td></tr> </table> <hr /><hr /> <a NAME="PasswordManager" ID="PasswordManager"></a> <h2>PasswordManager</h2> <p> Class implementing the password manager. </p><h3>Signals</h3> <dl> <dt>changed()</dt> <dd> emitted to indicate a change </dd><dt>passwordsSaved()</dt> <dd> emitted after the passwords were saved </dd> </dl> <h3>Derived from</h3> QObject <h3>Class Attributes</h3> <table> <tr><td>FORMS</td></tr><tr><td>NEVER</td></tr><tr><td>SEPARATOR</td></tr> </table> <h3>Class Methods</h3> <table> <tr><td>None</td></tr> </table> <h3>Methods</h3> <table> <tr> <td><a href="#PasswordManager.__init__">PasswordManager</a></td> <td>Constructor</td> </tr><tr> <td><a href="#PasswordManager.__createKey">__createKey</a></td> <td>Private method to create the key string for the login credentials.</td> </tr><tr> <td><a href="#PasswordManager.__extractMultipartQueryItems">__extractMultipartQueryItems</a></td> <td>Private method to extract the query items for a post operation.</td> </tr><tr> <td><a href="#PasswordManager.__findForm">__findForm</a></td> <td>Private method to find the form used for logging in.</td> </tr><tr> <td><a href="#PasswordManager.__load">__load</a></td> <td>Private method to load the saved login credentials.</td> </tr><tr> <td><a href="#PasswordManager.__loadNonXml">__loadNonXml</a></td> <td>Private method to load non-XML password files.</td> </tr><tr> <td><a href="#PasswordManager.__stripUrl">__stripUrl</a></td> <td>Private method to strip off all unneeded parts of a URL.</td> </tr><tr> <td><a href="#PasswordManager.allSiteNames">allSiteNames</a></td> <td>Public method to get a list of all site names.</td> </tr><tr> <td><a href="#PasswordManager.clear">clear</a></td> <td>Public slot to clear the saved passwords.</td> </tr><tr> <td><a href="#PasswordManager.close">close</a></td> <td>Public method to close the passwords manager.</td> </tr><tr> <td><a href="#PasswordManager.fill">fill</a></td> <td>Public slot to fill login forms with saved data.</td> </tr><tr> <td><a href="#PasswordManager.getFileName">getFileName</a></td> <td>Public method to get the file name of the passwords file.</td> </tr><tr> <td><a href="#PasswordManager.getLogin">getLogin</a></td> <td>Public method to get the login credentials.</td> </tr><tr> <td><a href="#PasswordManager.masterPasswordChanged">masterPasswordChanged</a></td> <td>Public slot to handle the change of the master password.</td> </tr><tr> <td><a href="#PasswordManager.post">post</a></td> <td>Public method to check, if the data to be sent contains login data.</td> </tr><tr> <td><a href="#PasswordManager.reload">reload</a></td> <td>Public method to reload the login data.</td> </tr><tr> <td><a href="#PasswordManager.removePassword">removePassword</a></td> <td>Public method to remove a password entry.</td> </tr><tr> <td><a href="#PasswordManager.save">save</a></td> <td>Public slot to save the login entries to disk.</td> </tr><tr> <td><a href="#PasswordManager.setLogin">setLogin</a></td> <td>Public method to set the login credentials.</td> </tr><tr> <td><a href="#PasswordManager.siteInfo">siteInfo</a></td> <td>Public method to get a reference to the named site.</td> </tr><tr> <td><a href="#PasswordManager.sitesCount">sitesCount</a></td> <td>Public method to get the number of available sites.</td> </tr> </table> <h3>Static Methods</h3> <table> <tr><td>None</td></tr> </table> <a NAME="PasswordManager.__init__" ID="PasswordManager.__init__"></a> <h4>PasswordManager (Constructor)</h4> <b>PasswordManager</b>(<i>parent=None</i>) <p> Constructor </p><dl> <dt><i>parent</i></dt> <dd> reference to the parent object (QObject) </dd> </dl><a NAME="PasswordManager.__createKey" ID="PasswordManager.__createKey"></a> <h4>PasswordManager.__createKey</h4> <b>__createKey</b>(<i>url, realm</i>) <p> Private method to create the key string for the login credentials. </p><dl> <dt><i>url</i></dt> <dd> URL to get the credentials for (QUrl) </dd><dt><i>realm</i></dt> <dd> realm to get the credentials for (string) </dd> </dl><dl> <dt>Returns:</dt> <dd> key string (string) </dd> </dl><a NAME="PasswordManager.__extractMultipartQueryItems" ID="PasswordManager.__extractMultipartQueryItems"></a> <h4>PasswordManager.__extractMultipartQueryItems</h4> <b>__extractMultipartQueryItems</b>(<i>data, boundary</i>) <p> Private method to extract the query items for a post operation. </p><dl> <dt><i>data</i></dt> <dd> data to be sent (QByteArray) </dd><dt><i>boundary</i></dt> <dd> boundary string (QByteArray) </dd> </dl><dl> <dt>Returns:</dt> <dd> set of name, value pairs (set of tuple of string, string) </dd> </dl><a NAME="PasswordManager.__findForm" ID="PasswordManager.__findForm"></a> <h4>PasswordManager.__findForm</h4> <b>__findForm</b>(<i>webPage, data, boundary=None</i>) <p> Private method to find the form used for logging in. </p><dl> <dt><i>webPage</i></dt> <dd> reference to the web page (QWebPage) </dd><dt><i>data</i></dt> <dd> data to be sent (QByteArray) </dd><dt><i>boundary=</i></dt> <dd> boundary string (QByteArray) for multipart encoded data, None for urlencoded data </dd> </dl><dl> <dt>Returns:</dt> <dd> parsed form (LoginForm) </dd> </dl><a NAME="PasswordManager.__load" ID="PasswordManager.__load"></a> <h4>PasswordManager.__load</h4> <b>__load</b>(<i></i>) <p> Private method to load the saved login credentials. </p><a NAME="PasswordManager.__loadNonXml" ID="PasswordManager.__loadNonXml"></a> <h4>PasswordManager.__loadNonXml</h4> <b>__loadNonXml</b>(<i>loginFile</i>) <p> Private method to load non-XML password files. </p><p> This method is to convert from the old, non-XML format to the new XML based format. </p><dl> <dt><i>loginFile</i></dt> <dd> name of the non-XML password file (string) </dd> </dl><a NAME="PasswordManager.__stripUrl" ID="PasswordManager.__stripUrl"></a> <h4>PasswordManager.__stripUrl</h4> <b>__stripUrl</b>(<i>url</i>) <p> Private method to strip off all unneeded parts of a URL. </p><dl> <dt><i>url</i></dt> <dd> URL to be stripped (QUrl) </dd> </dl><dl> <dt>Returns:</dt> <dd> stripped URL (QUrl) </dd> </dl><a NAME="PasswordManager.allSiteNames" ID="PasswordManager.allSiteNames"></a> <h4>PasswordManager.allSiteNames</h4> <b>allSiteNames</b>(<i></i>) <p> Public method to get a list of all site names. </p><dl> <dt>Returns:</dt> <dd> sorted list of all site names (list of strings) </dd> </dl><a NAME="PasswordManager.clear" ID="PasswordManager.clear"></a> <h4>PasswordManager.clear</h4> <b>clear</b>(<i></i>) <p> Public slot to clear the saved passwords. </p><a NAME="PasswordManager.close" ID="PasswordManager.close"></a> <h4>PasswordManager.close</h4> <b>close</b>(<i></i>) <p> Public method to close the passwords manager. </p><a NAME="PasswordManager.fill" ID="PasswordManager.fill"></a> <h4>PasswordManager.fill</h4> <b>fill</b>(<i>page</i>) <p> Public slot to fill login forms with saved data. </p><dl> <dt><i>page</i></dt> <dd> reference to the web page (QWebPage) </dd> </dl><a NAME="PasswordManager.getFileName" ID="PasswordManager.getFileName"></a> <h4>PasswordManager.getFileName</h4> <b>getFileName</b>(<i></i>) <p> Public method to get the file name of the passwords file. </p><dl> <dt>Returns:</dt> <dd> name of the passwords file (string) </dd> </dl><a NAME="PasswordManager.getLogin" ID="PasswordManager.getLogin"></a> <h4>PasswordManager.getLogin</h4> <b>getLogin</b>(<i>url, realm</i>) <p> Public method to get the login credentials. </p><dl> <dt><i>url</i></dt> <dd> URL to get the credentials for (QUrl) </dd><dt><i>realm</i></dt> <dd> realm to get the credentials for (string) </dd> </dl><dl> <dt>Returns:</dt> <dd> tuple containing the user name (string) and password (string) </dd> </dl><a NAME="PasswordManager.masterPasswordChanged" ID="PasswordManager.masterPasswordChanged"></a> <h4>PasswordManager.masterPasswordChanged</h4> <b>masterPasswordChanged</b>(<i>oldPassword, newPassword</i>) <p> Public slot to handle the change of the master password. </p><dl> <dt><i>oldPassword</i></dt> <dd> current master password (string) </dd><dt><i>newPassword</i></dt> <dd> new master password (string) </dd> </dl><a NAME="PasswordManager.post" ID="PasswordManager.post"></a> <h4>PasswordManager.post</h4> <b>post</b>(<i>request, data</i>) <p> Public method to check, if the data to be sent contains login data. </p><dl> <dt><i>request</i></dt> <dd> reference to the network request (QNetworkRequest) </dd><dt><i>data</i></dt> <dd> data to be sent (QByteArray) </dd> </dl><a NAME="PasswordManager.reload" ID="PasswordManager.reload"></a> <h4>PasswordManager.reload</h4> <b>reload</b>(<i></i>) <p> Public method to reload the login data. </p><a NAME="PasswordManager.removePassword" ID="PasswordManager.removePassword"></a> <h4>PasswordManager.removePassword</h4> <b>removePassword</b>(<i>site</i>) <p> Public method to remove a password entry. </p><dl> <dt><i>site</i></dt> <dd> web site name (string) </dd> </dl><a NAME="PasswordManager.save" ID="PasswordManager.save"></a> <h4>PasswordManager.save</h4> <b>save</b>(<i></i>) <p> Public slot to save the login entries to disk. </p><a NAME="PasswordManager.setLogin" ID="PasswordManager.setLogin"></a> <h4>PasswordManager.setLogin</h4> <b>setLogin</b>(<i>url, realm, username, password</i>) <p> Public method to set the login credentials. </p><dl> <dt><i>url</i></dt> <dd> URL to set the credentials for (QUrl) </dd><dt><i>realm</i></dt> <dd> realm to set the credentials for (string) </dd><dt><i>username</i></dt> <dd> username for the login (string) </dd><dt><i>password</i></dt> <dd> password for the login (string) </dd> </dl><a NAME="PasswordManager.siteInfo" ID="PasswordManager.siteInfo"></a> <h4>PasswordManager.siteInfo</h4> <b>siteInfo</b>(<i>site</i>) <p> Public method to get a reference to the named site. </p><dl> <dt><i>site</i></dt> <dd> web site name (string) </dd> </dl><dl> <dt>Returns:</dt> <dd> tuple containing the user name (string) and password (string) </dd> </dl><a NAME="PasswordManager.sitesCount" ID="PasswordManager.sitesCount"></a> <h4>PasswordManager.sitesCount</h4> <b>sitesCount</b>(<i></i>) <p> Public method to get the number of available sites. </p><dl> <dt>Returns:</dt> <dd> number of sites (integer) </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> </body></html>