Mon, 02 Apr 2018 17:43:26 +0200
Updated source docu.
<!DOCTYPE html> <html><head> <title>Plugin_Refactoring_Rope.RefactoringRope.JsonClient</title> <meta charset="UTF-8"> <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>Plugin_Refactoring_Rope.RefactoringRope.JsonClient</h1> <p> Module implementing the JSON based client base class. </p> <h3>Global Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Classes</h3> <table> <tr> <td><a href="#JsonClient">JsonClient</a></td> <td>Class implementing the JSON based client base class.</td> </tr> </table> <h3>Functions</h3> <table> <tr><td>None</td></tr> </table> <hr /><hr /> <a NAME="JsonClient" ID="JsonClient"></a> <h2>JsonClient</h2> <p> Class implementing the JSON based client base class. </p> <h3>Derived from</h3> object <h3>Class Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Class Methods</h3> <table> <tr><td>None</td></tr> </table> <h3>Methods</h3> <table> <tr> <td><a href="#JsonClient.__init__">JsonClient</a></td> <td>Constructor</td> </tr><tr> <td><a href="#JsonClient.__receiveJson">__receiveJson</a></td> <td>Private method to receive a JSON encode command and data from the server.</td> </tr><tr> <td><a href="#JsonClient.handleCall">handleCall</a></td> <td>Public method to handle a method call from the server.</td> </tr><tr> <td><a href="#JsonClient.poll">poll</a></td> <td>Public method to check and receive one message (if available).</td> </tr><tr> <td><a href="#JsonClient.run">run</a></td> <td>Public method implementing the main loop of the client.</td> </tr><tr> <td><a href="#JsonClient.sendJson">sendJson</a></td> <td>Public method to send a single refactoring command to the server.</td> </tr> </table> <h3>Static Methods</h3> <table> <tr><td>None</td></tr> </table> <a NAME="JsonClient.__init__" ID="JsonClient.__init__"></a> <h4>JsonClient (Constructor)</h4> <b>JsonClient</b>(<i>host, port, idString=""</i>) <p> Constructor </p><dl> <dt><i>host</i> (str)</dt> <dd> ip address the background service is listening </dd><dt><i>port</i> (int)</dt> <dd> port of the background service </dd><dt><i>idString</i> (str)</dt> <dd> assigned client id to be sent back to the server in order to identify the connection </dd> </dl><a NAME="JsonClient.__receiveJson" ID="JsonClient.__receiveJson"></a> <h4>JsonClient.__receiveJson</h4> <b>__receiveJson</b>(<i></i>) <p> Private method to receive a JSON encode command and data from the server. </p><dl> <dt>Returns:</dt> <dd> tuple containing the received command and a dictionary containing the associated data </dd> </dl><dl> <dt>Return Type:</dt> <dd> tuple of (str, dict) </dd> </dl><a NAME="JsonClient.handleCall" ID="JsonClient.handleCall"></a> <h4>JsonClient.handleCall</h4> <b>handleCall</b>(<i>method, params</i>) <p> Public method to handle a method call from the server. </p><p> Note: This is an empty implementation that must be overridden in derived classes. </p><dl> <dt><i>method</i> (str)</dt> <dd> requested method name </dd><dt><i>params</i> (dict)</dt> <dd> dictionary with method specific parameters </dd> </dl><a NAME="JsonClient.poll" ID="JsonClient.poll"></a> <h4>JsonClient.poll</h4> <b>poll</b>(<i>waitMethod=""</i>) <p> Public method to check and receive one message (if available). </p><dl> <dt><i>waitMethod</i> (str)</dt> <dd> name of a method to wait for </dd> </dl><dl> <dt>Returns:</dt> <dd> dictionary containing the data of the waited for method </dd> </dl><dl> <dt>Return Type:</dt> <dd> dict </dd> </dl><a NAME="JsonClient.run" ID="JsonClient.run"></a> <h4>JsonClient.run</h4> <b>run</b>(<i></i>) <p> Public method implementing the main loop of the client. </p><a NAME="JsonClient.sendJson" ID="JsonClient.sendJson"></a> <h4>JsonClient.sendJson</h4> <b>sendJson</b>(<i>command, params</i>) <p> Public method to send a single refactoring command to the server. </p><dl> <dt><i>command</i> (str)</dt> <dd> command name to be sent </dd><dt><i>params</i> (dict)</dt> <dd> dictionary of named parameters for the command </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> </body></html>