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.JsonServer</h1> |
23 <h1>Plugin_Refactoring_Rope.RefactoringRope.JsonServer</h1> |
|
24 |
23 <p> |
25 <p> |
24 Module implementing the JSON based server base class. |
26 Module implementing the JSON based server 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="#JsonServer">JsonServer</a></td> |
38 <td><a href="#JsonServer">JsonServer</a></td> |
34 <td>Class implementing the JSON based server base class.</td> |
39 <td>Class implementing the JSON based server 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="JsonServer" ID="JsonServer"></a> |
49 <a NAME="JsonServer" ID="JsonServer"></a> |
43 <h2>JsonServer</h2> |
50 <h2>JsonServer</h2> |
|
51 |
44 <p> |
52 <p> |
45 Class implementing the JSON based server base class. |
53 Class implementing the JSON based server base class. |
46 </p> |
54 </p> |
47 <h3>Derived from</h3> |
55 <h3>Derived from</h3> |
48 QTcpServer |
56 QTcpServer |
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="#JsonServer.__init__">JsonServer</a></td> |
72 <td><a href="#JsonServer.__init__">JsonServer</a></td> |
61 <td>Constructor</td> |
73 <td>Constructor</td> |
62 </tr><tr> |
74 </tr> |
|
75 <tr> |
63 <td><a href="#JsonServer.__handleDisconnect">__handleDisconnect</a></td> |
76 <td><a href="#JsonServer.__handleDisconnect">__handleDisconnect</a></td> |
64 <td>Private slot handling a disconnect of the client.</td> |
77 <td>Private slot handling a disconnect of the client.</td> |
65 </tr><tr> |
78 </tr> |
|
79 <tr> |
66 <td><a href="#JsonServer.__receiveJson">__receiveJson</a></td> |
80 <td><a href="#JsonServer.__receiveJson">__receiveJson</a></td> |
67 <td>Private slot handling received data from the client.</td> |
81 <td>Private slot handling received data from the client.</td> |
68 </tr><tr> |
82 </tr> |
|
83 <tr> |
69 <td><a href="#JsonServer.connectionNames">connectionNames</a></td> |
84 <td><a href="#JsonServer.connectionNames">connectionNames</a></td> |
70 <td>Public method to get the list of active connection names.</td> |
85 <td>Public method to get the list of active connection names.</td> |
71 </tr><tr> |
86 </tr> |
|
87 <tr> |
72 <td><a href="#JsonServer.handleCall">handleCall</a></td> |
88 <td><a href="#JsonServer.handleCall">handleCall</a></td> |
73 <td>Public method to handle a method call from the client.</td> |
89 <td>Public method to handle a method call from the client.</td> |
74 </tr><tr> |
90 </tr> |
|
91 <tr> |
75 <td><a href="#JsonServer.handleNewConnection">handleNewConnection</a></td> |
92 <td><a href="#JsonServer.handleNewConnection">handleNewConnection</a></td> |
76 <td>Public slot for new incoming connections from a client.</td> |
93 <td>Public slot for new incoming connections from a client.</td> |
77 </tr><tr> |
94 </tr> |
|
95 <tr> |
78 <td><a href="#JsonServer.sendJson">sendJson</a></td> |
96 <td><a href="#JsonServer.sendJson">sendJson</a></td> |
79 <td>Public method to send a single command to a client.</td> |
97 <td>Public method to send a single command to a client.</td> |
80 </tr><tr> |
98 </tr> |
|
99 <tr> |
81 <td><a href="#JsonServer.startClient">startClient</a></td> |
100 <td><a href="#JsonServer.startClient">startClient</a></td> |
82 <td>Public method to start a client process.</td> |
101 <td>Public method to start a client process.</td> |
83 </tr><tr> |
102 </tr> |
|
103 <tr> |
84 <td><a href="#JsonServer.stopAllClients">stopAllClients</a></td> |
104 <td><a href="#JsonServer.stopAllClients">stopAllClients</a></td> |
85 <td>Public method to stop all clients.</td> |
105 <td>Public method to stop all clients.</td> |
86 </tr><tr> |
106 </tr> |
|
107 <tr> |
87 <td><a href="#JsonServer.stopClient">stopClient</a></td> |
108 <td><a href="#JsonServer.stopClient">stopClient</a></td> |
88 <td>Public method to stop a client process.</td> |
109 <td>Public method to stop a client process.</td> |
89 </tr> |
110 </tr> |
90 </table> |
111 </table> |
91 <h3>Static Methods</h3> |
112 <h3>Static Methods</h3> |
92 <table> |
113 |
93 <tr><td>None</td></tr> |
114 <table> |
94 </table> |
115 <tr><td>None</td></tr> |
|
116 </table> |
|
117 |
95 <a NAME="JsonServer.__init__" ID="JsonServer.__init__"></a> |
118 <a NAME="JsonServer.__init__" ID="JsonServer.__init__"></a> |
96 <h4>JsonServer (Constructor)</h4> |
119 <h4>JsonServer (Constructor)</h4> |
97 <b>JsonServer</b>(<i>name="", multiplex=False, parent=None</i>) |
120 <b>JsonServer</b>(<i>name="", multiplex=False, parent=None</i>) |
|
121 |
98 <p> |
122 <p> |
99 Constructor |
123 Constructor |
100 </p><dl> |
124 </p> |
|
125 <dl> |
|
126 |
101 <dt><i>name</i> (str)</dt> |
127 <dt><i>name</i> (str)</dt> |
102 <dd> |
128 <dd> |
103 name of the server (used for output only) |
129 name of the server (used for output only) |
104 </dd><dt><i>multiplex</i> (bool)</dt> |
130 </dd> |
|
131 <dt><i>multiplex</i> (bool)</dt> |
105 <dd> |
132 <dd> |
106 flag indicating a multiplexing server |
133 flag indicating a multiplexing server |
107 </dd><dt><i>parent</i> (QObject)</dt> |
134 </dd> |
|
135 <dt><i>parent</i> (QObject)</dt> |
108 <dd> |
136 <dd> |
109 parent object |
137 parent object |
110 </dd> |
138 </dd> |
111 </dl><a NAME="JsonServer.__handleDisconnect" ID="JsonServer.__handleDisconnect"></a> |
139 </dl> |
|
140 <a NAME="JsonServer.__handleDisconnect" ID="JsonServer.__handleDisconnect"></a> |
112 <h4>JsonServer.__handleDisconnect</h4> |
141 <h4>JsonServer.__handleDisconnect</h4> |
113 <b>__handleDisconnect</b>(<i>idString</i>) |
142 <b>__handleDisconnect</b>(<i>idString</i>) |
|
143 |
114 <p> |
144 <p> |
115 Private slot handling a disconnect of the client. |
145 Private slot handling a disconnect of the client. |
116 </p><dl> |
146 </p> |
|
147 <dl> |
|
148 |
117 <dt><i>idString</i> (str)</dt> |
149 <dt><i>idString</i> (str)</dt> |
118 <dd> |
150 <dd> |
119 id of the connection been disconnected |
151 id of the connection been disconnected |
120 </dd> |
152 </dd> |
121 </dl><a NAME="JsonServer.__receiveJson" ID="JsonServer.__receiveJson"></a> |
153 </dl> |
|
154 <a NAME="JsonServer.__receiveJson" ID="JsonServer.__receiveJson"></a> |
122 <h4>JsonServer.__receiveJson</h4> |
155 <h4>JsonServer.__receiveJson</h4> |
123 <b>__receiveJson</b>(<i>idString</i>) |
156 <b>__receiveJson</b>(<i>idString</i>) |
|
157 |
124 <p> |
158 <p> |
125 Private slot handling received data from the client. |
159 Private slot handling received data from the client. |
126 </p><dl> |
160 </p> |
|
161 <dl> |
|
162 |
127 <dt><i>idString</i> (str)</dt> |
163 <dt><i>idString</i> (str)</dt> |
128 <dd> |
164 <dd> |
129 id of the connection been disconnected |
165 id of the connection been disconnected |
130 </dd> |
166 </dd> |
131 </dl><a NAME="JsonServer.connectionNames" ID="JsonServer.connectionNames"></a> |
167 </dl> |
|
168 <a NAME="JsonServer.connectionNames" ID="JsonServer.connectionNames"></a> |
132 <h4>JsonServer.connectionNames</h4> |
169 <h4>JsonServer.connectionNames</h4> |
133 <b>connectionNames</b>(<i></i>) |
170 <b>connectionNames</b>(<i></i>) |
|
171 |
134 <p> |
172 <p> |
135 Public method to get the list of active connection names. |
173 Public method to get the list of active connection names. |
136 </p><p> |
174 </p> |
|
175 <p> |
137 If this is not a multiplexing server, an empty list is returned. |
176 If this is not a multiplexing server, an empty list is returned. |
138 </p><dl> |
177 </p> |
|
178 <dl> |
139 <dt>Returns:</dt> |
179 <dt>Returns:</dt> |
140 <dd> |
180 <dd> |
141 list of active connection names |
181 list of active connection names |
142 </dd> |
182 </dd> |
143 </dl><dl> |
183 </dl> |
|
184 <dl> |
144 <dt>Return Type:</dt> |
185 <dt>Return Type:</dt> |
145 <dd> |
186 <dd> |
146 list of str |
187 list of str |
147 </dd> |
188 </dd> |
148 </dl><a NAME="JsonServer.handleCall" ID="JsonServer.handleCall"></a> |
189 </dl> |
|
190 <a NAME="JsonServer.handleCall" ID="JsonServer.handleCall"></a> |
149 <h4>JsonServer.handleCall</h4> |
191 <h4>JsonServer.handleCall</h4> |
150 <b>handleCall</b>(<i>method, params</i>) |
192 <b>handleCall</b>(<i>method, params</i>) |
|
193 |
151 <p> |
194 <p> |
152 Public method to handle a method call from the client. |
195 Public method to handle a method call from the client. |
153 </p><p> |
196 </p> |
|
197 <p> |
154 Note: This is an empty implementation that must be overridden in |
198 Note: This is an empty implementation that must be overridden in |
155 derived classes. |
199 derived classes. |
156 </p><dl> |
200 </p> |
|
201 <dl> |
|
202 |
157 <dt><i>method</i> (str)</dt> |
203 <dt><i>method</i> (str)</dt> |
158 <dd> |
204 <dd> |
159 requested method name |
205 requested method name |
160 </dd><dt><i>params</i> (dict)</dt> |
206 </dd> |
|
207 <dt><i>params</i> (dict)</dt> |
161 <dd> |
208 <dd> |
162 dictionary with method specific parameters |
209 dictionary with method specific parameters |
163 </dd> |
210 </dd> |
164 </dl><a NAME="JsonServer.handleNewConnection" ID="JsonServer.handleNewConnection"></a> |
211 </dl> |
|
212 <a NAME="JsonServer.handleNewConnection" ID="JsonServer.handleNewConnection"></a> |
165 <h4>JsonServer.handleNewConnection</h4> |
213 <h4>JsonServer.handleNewConnection</h4> |
166 <b>handleNewConnection</b>(<i></i>) |
214 <b>handleNewConnection</b>(<i></i>) |
|
215 |
167 <p> |
216 <p> |
168 Public slot for new incoming connections from a client. |
217 Public slot for new incoming connections from a client. |
169 </p><a NAME="JsonServer.sendJson" ID="JsonServer.sendJson"></a> |
218 </p> |
|
219 <a NAME="JsonServer.sendJson" ID="JsonServer.sendJson"></a> |
170 <h4>JsonServer.sendJson</h4> |
220 <h4>JsonServer.sendJson</h4> |
171 <b>sendJson</b>(<i>command, params, flush=False, idString=""</i>) |
221 <b>sendJson</b>(<i>command, params, flush=False, idString=""</i>) |
|
222 |
172 <p> |
223 <p> |
173 Public method to send a single command to a client. |
224 Public method to send a single command to a client. |
174 </p><dl> |
225 </p> |
|
226 <dl> |
|
227 |
175 <dt><i>command</i> (str)</dt> |
228 <dt><i>command</i> (str)</dt> |
176 <dd> |
229 <dd> |
177 command name to be sent |
230 command name to be sent |
178 </dd><dt><i>params</i> (dict)</dt> |
231 </dd> |
|
232 <dt><i>params</i> (dict)</dt> |
179 <dd> |
233 <dd> |
180 dictionary of named parameters for the command |
234 dictionary of named parameters for the command |
181 </dd><dt><i>flush</i> (bool)</dt> |
235 </dd> |
|
236 <dt><i>flush</i> (bool)</dt> |
182 <dd> |
237 <dd> |
183 flag indicating to flush the data to the socket |
238 flag indicating to flush the data to the socket |
184 </dd><dt><i>idString</i> (str)</dt> |
239 </dd> |
|
240 <dt><i>idString</i> (str)</dt> |
185 <dd> |
241 <dd> |
186 id of the connection to send data to |
242 id of the connection to send data to |
187 </dd> |
243 </dd> |
188 </dl><a NAME="JsonServer.startClient" ID="JsonServer.startClient"></a> |
244 </dl> |
|
245 <a NAME="JsonServer.startClient" ID="JsonServer.startClient"></a> |
189 <h4>JsonServer.startClient</h4> |
246 <h4>JsonServer.startClient</h4> |
190 <b>startClient</b>(<i>interpreter, clientScript, clientArgs, idString="", environment=None</i>) |
247 <b>startClient</b>(<i>interpreter, clientScript, clientArgs, idString="", environment=None</i>) |
|
248 |
191 <p> |
249 <p> |
192 Public method to start a client process. |
250 Public method to start a client process. |
193 </p><dl> |
251 </p> |
|
252 <dl> |
|
253 |
194 <dt><i>interpreter</i> (str)</dt> |
254 <dt><i>interpreter</i> (str)</dt> |
195 <dd> |
255 <dd> |
196 interpreter to be used for the client |
256 interpreter to be used for the client |
197 </dd><dt><i>clientScript</i> (str)</dt> |
257 </dd> |
|
258 <dt><i>clientScript</i> (str)</dt> |
198 <dd> |
259 <dd> |
199 path to the client script |
260 path to the client script |
200 </dd><dt><i>clientArgs</i></dt> |
261 </dd> |
|
262 <dt><i>clientArgs</i></dt> |
201 <dd> |
263 <dd> |
202 list of arguments for the client |
264 list of arguments for the client |
203 </dd><dt><i>idString</i> (str)</dt> |
265 </dd> |
|
266 <dt><i>idString</i> (str)</dt> |
204 <dd> |
267 <dd> |
205 id of the client to be started |
268 id of the client to be started |
206 </dd><dt><i>environment</i> (dict)</dt> |
269 </dd> |
|
270 <dt><i>environment</i> (dict)</dt> |
207 <dd> |
271 <dd> |
208 dictionary of environment settings to pass |
272 dictionary of environment settings to pass |
209 </dd> |
273 </dd> |
210 </dl><dl> |
274 </dl> |
|
275 <dl> |
211 <dt>Returns:</dt> |
276 <dt>Returns:</dt> |
212 <dd> |
277 <dd> |
213 flag indicating a successful client start |
278 flag indicating a successful client start |
214 </dd> |
279 </dd> |
215 </dl><dl> |
280 </dl> |
|
281 <dl> |
216 <dt>Return Type:</dt> |
282 <dt>Return Type:</dt> |
217 <dd> |
283 <dd> |
218 bool |
284 bool |
219 </dd> |
285 </dd> |
220 </dl><a NAME="JsonServer.stopAllClients" ID="JsonServer.stopAllClients"></a> |
286 </dl> |
|
287 <a NAME="JsonServer.stopAllClients" ID="JsonServer.stopAllClients"></a> |
221 <h4>JsonServer.stopAllClients</h4> |
288 <h4>JsonServer.stopAllClients</h4> |
222 <b>stopAllClients</b>(<i></i>) |
289 <b>stopAllClients</b>(<i></i>) |
|
290 |
223 <p> |
291 <p> |
224 Public method to stop all clients. |
292 Public method to stop all clients. |
225 </p><a NAME="JsonServer.stopClient" ID="JsonServer.stopClient"></a> |
293 </p> |
|
294 <a NAME="JsonServer.stopClient" ID="JsonServer.stopClient"></a> |
226 <h4>JsonServer.stopClient</h4> |
295 <h4>JsonServer.stopClient</h4> |
227 <b>stopClient</b>(<i>idString=""</i>) |
296 <b>stopClient</b>(<i>idString=""</i>) |
|
297 |
228 <p> |
298 <p> |
229 Public method to stop a client process. |
299 Public method to stop a client process. |
230 </p><dl> |
300 </p> |
|
301 <dl> |
|
302 |
231 <dt><i>idString</i> (str)</dt> |
303 <dt><i>idString</i> (str)</dt> |
232 <dd> |
304 <dd> |
233 id of the client to be stopped |
305 id of the client to be stopped |
234 </dd> |
306 </dd> |
235 </dl> |
307 </dl> |