16 |
16 |
17 a { color: #BA6D36; } |
17 a { color: #BA6D36; } |
18 |
18 |
19 </style> |
19 </style> |
20 </head> |
20 </head> |
21 <body><a NAME="top" ID="top"></a> |
21 <body> |
|
22 <a NAME="top" ID="top"></a> |
22 <h1>Plugin_Refactoring_Rope.RefactoringRope.JsonClient</h1> |
23 <h1>Plugin_Refactoring_Rope.RefactoringRope.JsonClient</h1> |
|
24 |
23 <p> |
25 <p> |
24 Module implementing the JSON based client base class. |
26 Module implementing the JSON based client base class. |
25 </p> |
27 </p> |
26 <h3>Global Attributes</h3> |
28 <h3>Global Attributes</h3> |
|
29 |
27 <table> |
30 <table> |
28 <tr><td>None</td></tr> |
31 <tr><td>None</td></tr> |
29 </table> |
32 </table> |
30 <h3>Classes</h3> |
33 <h3>Classes</h3> |
31 <table> |
34 |
|
35 <table> |
|
36 |
32 <tr> |
37 <tr> |
33 <td><a href="#JsonClient">JsonClient</a></td> |
38 <td><a href="#JsonClient">JsonClient</a></td> |
34 <td>Class implementing the JSON based client base class.</td> |
39 <td>Class implementing the JSON based client base class.</td> |
35 </tr> |
40 </tr> |
36 </table> |
41 </table> |
37 <h3>Functions</h3> |
42 <h3>Functions</h3> |
38 <table> |
43 |
39 <tr><td>None</td></tr> |
44 <table> |
40 </table> |
45 <tr><td>None</td></tr> |
41 <hr /><hr /> |
46 </table> |
|
47 <hr /> |
|
48 <hr /> |
42 <a NAME="JsonClient" ID="JsonClient"></a> |
49 <a NAME="JsonClient" ID="JsonClient"></a> |
43 <h2>JsonClient</h2> |
50 <h2>JsonClient</h2> |
|
51 |
44 <p> |
52 <p> |
45 Class implementing the JSON based client base class. |
53 Class implementing the JSON based client base class. |
46 </p> |
54 </p> |
47 <h3>Derived from</h3> |
55 <h3>Derived from</h3> |
48 object |
56 object |
49 <h3>Class Attributes</h3> |
57 <h3>Class Attributes</h3> |
|
58 |
50 <table> |
59 <table> |
51 <tr><td>None</td></tr> |
60 <tr><td>None</td></tr> |
52 </table> |
61 </table> |
53 <h3>Class Methods</h3> |
62 <h3>Class Methods</h3> |
|
63 |
54 <table> |
64 <table> |
55 <tr><td>None</td></tr> |
65 <tr><td>None</td></tr> |
56 </table> |
66 </table> |
57 <h3>Methods</h3> |
67 <h3>Methods</h3> |
58 <table> |
68 |
|
69 <table> |
|
70 |
59 <tr> |
71 <tr> |
60 <td><a href="#JsonClient.__init__">JsonClient</a></td> |
72 <td><a href="#JsonClient.__init__">JsonClient</a></td> |
61 <td>Constructor</td> |
73 <td>Constructor</td> |
62 </tr><tr> |
74 </tr> |
|
75 <tr> |
63 <td><a href="#JsonClient.__receiveJson">__receiveJson</a></td> |
76 <td><a href="#JsonClient.__receiveJson">__receiveJson</a></td> |
64 <td>Private method to receive a JSON encode command and data from the server.</td> |
77 <td>Private method to receive a JSON encode command and data from the server.</td> |
65 </tr><tr> |
78 </tr> |
|
79 <tr> |
66 <td><a href="#JsonClient.handleCall">handleCall</a></td> |
80 <td><a href="#JsonClient.handleCall">handleCall</a></td> |
67 <td>Public method to handle a method call from the server.</td> |
81 <td>Public method to handle a method call from the server.</td> |
68 </tr><tr> |
82 </tr> |
|
83 <tr> |
69 <td><a href="#JsonClient.poll">poll</a></td> |
84 <td><a href="#JsonClient.poll">poll</a></td> |
70 <td>Public method to check and receive one message (if available).</td> |
85 <td>Public method to check and receive one message (if available).</td> |
71 </tr><tr> |
86 </tr> |
|
87 <tr> |
72 <td><a href="#JsonClient.run">run</a></td> |
88 <td><a href="#JsonClient.run">run</a></td> |
73 <td>Public method implementing the main loop of the client.</td> |
89 <td>Public method implementing the main loop of the client.</td> |
74 </tr><tr> |
90 </tr> |
|
91 <tr> |
75 <td><a href="#JsonClient.sendJson">sendJson</a></td> |
92 <td><a href="#JsonClient.sendJson">sendJson</a></td> |
76 <td>Public method to send a single refactoring command to the server.</td> |
93 <td>Public method to send a single refactoring command to the server.</td> |
77 </tr> |
94 </tr> |
78 </table> |
95 </table> |
79 <h3>Static Methods</h3> |
96 <h3>Static Methods</h3> |
80 <table> |
97 |
81 <tr><td>None</td></tr> |
98 <table> |
82 </table> |
99 <tr><td>None</td></tr> |
|
100 </table> |
|
101 |
83 <a NAME="JsonClient.__init__" ID="JsonClient.__init__"></a> |
102 <a NAME="JsonClient.__init__" ID="JsonClient.__init__"></a> |
84 <h4>JsonClient (Constructor)</h4> |
103 <h4>JsonClient (Constructor)</h4> |
85 <b>JsonClient</b>(<i>host, port, idString=""</i>) |
104 <b>JsonClient</b>(<i>host, port, idString=""</i>) |
|
105 |
86 <p> |
106 <p> |
87 Constructor |
107 Constructor |
88 </p><dl> |
108 </p> |
|
109 <dl> |
|
110 |
89 <dt><i>host</i> (str)</dt> |
111 <dt><i>host</i> (str)</dt> |
90 <dd> |
112 <dd> |
91 ip address the background service is listening |
113 ip address the background service is listening |
92 </dd><dt><i>port</i> (int)</dt> |
114 </dd> |
|
115 <dt><i>port</i> (int)</dt> |
93 <dd> |
116 <dd> |
94 port of the background service |
117 port of the background service |
95 </dd><dt><i>idString</i> (str)</dt> |
118 </dd> |
|
119 <dt><i>idString</i> (str)</dt> |
96 <dd> |
120 <dd> |
97 assigned client id to be sent back to the server in |
121 assigned client id to be sent back to the server in |
98 order to identify the connection |
122 order to identify the connection |
99 </dd> |
123 </dd> |
100 </dl><a NAME="JsonClient.__receiveJson" ID="JsonClient.__receiveJson"></a> |
124 </dl> |
|
125 <a NAME="JsonClient.__receiveJson" ID="JsonClient.__receiveJson"></a> |
101 <h4>JsonClient.__receiveJson</h4> |
126 <h4>JsonClient.__receiveJson</h4> |
102 <b>__receiveJson</b>(<i></i>) |
127 <b>__receiveJson</b>(<i></i>) |
|
128 |
103 <p> |
129 <p> |
104 Private method to receive a JSON encode command and data from the |
130 Private method to receive a JSON encode command and data from the |
105 server. |
131 server. |
106 </p><dl> |
132 </p> |
|
133 <dl> |
107 <dt>Returns:</dt> |
134 <dt>Returns:</dt> |
108 <dd> |
135 <dd> |
109 tuple containing the received command and a dictionary |
136 tuple containing the received command and a dictionary |
110 containing the associated data |
137 containing the associated data |
111 </dd> |
138 </dd> |
112 </dl><dl> |
139 </dl> |
|
140 <dl> |
113 <dt>Return Type:</dt> |
141 <dt>Return Type:</dt> |
114 <dd> |
142 <dd> |
115 tuple of (str, dict) |
143 tuple of (str, dict) |
116 </dd> |
144 </dd> |
117 </dl><a NAME="JsonClient.handleCall" ID="JsonClient.handleCall"></a> |
145 </dl> |
|
146 <a NAME="JsonClient.handleCall" ID="JsonClient.handleCall"></a> |
118 <h4>JsonClient.handleCall</h4> |
147 <h4>JsonClient.handleCall</h4> |
119 <b>handleCall</b>(<i>method, params</i>) |
148 <b>handleCall</b>(<i>method, params</i>) |
|
149 |
120 <p> |
150 <p> |
121 Public method to handle a method call from the server. |
151 Public method to handle a method call from the server. |
122 </p><p> |
152 </p> |
|
153 <p> |
123 Note: This is an empty implementation that must be overridden in |
154 Note: This is an empty implementation that must be overridden in |
124 derived classes. |
155 derived classes. |
125 </p><dl> |
156 </p> |
|
157 <dl> |
|
158 |
126 <dt><i>method</i> (str)</dt> |
159 <dt><i>method</i> (str)</dt> |
127 <dd> |
160 <dd> |
128 requested method name |
161 requested method name |
129 </dd><dt><i>params</i> (dict)</dt> |
162 </dd> |
|
163 <dt><i>params</i> (dict)</dt> |
130 <dd> |
164 <dd> |
131 dictionary with method specific parameters |
165 dictionary with method specific parameters |
132 </dd> |
166 </dd> |
133 </dl><a NAME="JsonClient.poll" ID="JsonClient.poll"></a> |
167 </dl> |
|
168 <a NAME="JsonClient.poll" ID="JsonClient.poll"></a> |
134 <h4>JsonClient.poll</h4> |
169 <h4>JsonClient.poll</h4> |
135 <b>poll</b>(<i>waitMethod=""</i>) |
170 <b>poll</b>(<i>waitMethod=""</i>) |
|
171 |
136 <p> |
172 <p> |
137 Public method to check and receive one message (if available). |
173 Public method to check and receive one message (if available). |
138 </p><dl> |
174 </p> |
|
175 <dl> |
|
176 |
139 <dt><i>waitMethod</i> (str)</dt> |
177 <dt><i>waitMethod</i> (str)</dt> |
140 <dd> |
178 <dd> |
141 name of a method to wait for |
179 name of a method to wait for |
142 </dd> |
180 </dd> |
143 </dl><dl> |
181 </dl> |
|
182 <dl> |
144 <dt>Returns:</dt> |
183 <dt>Returns:</dt> |
145 <dd> |
184 <dd> |
146 dictionary containing the data of the waited for method |
185 dictionary containing the data of the waited for method |
147 </dd> |
186 </dd> |
148 </dl><dl> |
187 </dl> |
|
188 <dl> |
149 <dt>Return Type:</dt> |
189 <dt>Return Type:</dt> |
150 <dd> |
190 <dd> |
151 dict |
191 dict |
152 </dd> |
192 </dd> |
153 </dl><a NAME="JsonClient.run" ID="JsonClient.run"></a> |
193 </dl> |
|
194 <a NAME="JsonClient.run" ID="JsonClient.run"></a> |
154 <h4>JsonClient.run</h4> |
195 <h4>JsonClient.run</h4> |
155 <b>run</b>(<i></i>) |
196 <b>run</b>(<i></i>) |
|
197 |
156 <p> |
198 <p> |
157 Public method implementing the main loop of the client. |
199 Public method implementing the main loop of the client. |
158 </p><a NAME="JsonClient.sendJson" ID="JsonClient.sendJson"></a> |
200 </p> |
|
201 <a NAME="JsonClient.sendJson" ID="JsonClient.sendJson"></a> |
159 <h4>JsonClient.sendJson</h4> |
202 <h4>JsonClient.sendJson</h4> |
160 <b>sendJson</b>(<i>command, params</i>) |
203 <b>sendJson</b>(<i>command, params</i>) |
|
204 |
161 <p> |
205 <p> |
162 Public method to send a single refactoring command to the server. |
206 Public method to send a single refactoring command to the server. |
163 </p><dl> |
207 </p> |
|
208 <dl> |
|
209 |
164 <dt><i>command</i> (str)</dt> |
210 <dt><i>command</i> (str)</dt> |
165 <dd> |
211 <dd> |
166 command name to be sent |
212 command name to be sent |
167 </dd><dt><i>params</i> (dict)</dt> |
213 </dd> |
|
214 <dt><i>params</i> (dict)</dt> |
168 <dd> |
215 <dd> |
169 dictionary of named parameters for the command |
216 dictionary of named parameters for the command |
170 </dd> |
217 </dd> |
171 </dl> |
218 </dl> |
172 <div align="right"><a href="#top">Up</a></div> |
219 <div align="right"><a href="#top">Up</a></div> |