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>eric6.Toolbox.SingleApplication</h1> |
23 <h1>eric6.Toolbox.SingleApplication</h1> |
|
24 |
23 <p> |
25 <p> |
24 Module implementing the single application server and client. |
26 Module implementing the single application server and client. |
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="#SingleApplicationClient">SingleApplicationClient</a></td> |
38 <td><a href="#SingleApplicationClient">SingleApplicationClient</a></td> |
34 <td>Class implementing the single application client base class.</td> |
39 <td>Class implementing the single application client base class.</td> |
35 </tr><tr> |
40 </tr> |
|
41 <tr> |
36 <td><a href="#SingleApplicationServer">SingleApplicationServer</a></td> |
42 <td><a href="#SingleApplicationServer">SingleApplicationServer</a></td> |
37 <td>Class implementing the single application server base class.</td> |
43 <td>Class implementing the single application server base class.</td> |
38 </tr> |
44 </tr> |
39 </table> |
45 </table> |
40 <h3>Functions</h3> |
46 <h3>Functions</h3> |
41 <table> |
47 |
42 <tr><td>None</td></tr> |
48 <table> |
43 </table> |
49 <tr><td>None</td></tr> |
44 <hr /><hr /> |
50 </table> |
|
51 <hr /> |
|
52 <hr /> |
45 <a NAME="SingleApplicationClient" ID="SingleApplicationClient"></a> |
53 <a NAME="SingleApplicationClient" ID="SingleApplicationClient"></a> |
46 <h2>SingleApplicationClient</h2> |
54 <h2>SingleApplicationClient</h2> |
|
55 |
47 <p> |
56 <p> |
48 Class implementing the single application client base class. |
57 Class implementing the single application client base class. |
49 </p> |
58 </p> |
50 <h3>Derived from</h3> |
59 <h3>Derived from</h3> |
51 object |
60 object |
52 <h3>Class Attributes</h3> |
61 <h3>Class Attributes</h3> |
|
62 |
53 <table> |
63 <table> |
54 <tr><td>None</td></tr> |
64 <tr><td>None</td></tr> |
55 </table> |
65 </table> |
56 <h3>Class Methods</h3> |
66 <h3>Class Methods</h3> |
|
67 |
57 <table> |
68 <table> |
58 <tr><td>None</td></tr> |
69 <tr><td>None</td></tr> |
59 </table> |
70 </table> |
60 <h3>Methods</h3> |
71 <h3>Methods</h3> |
61 <table> |
72 |
|
73 <table> |
|
74 |
62 <tr> |
75 <tr> |
63 <td><a href="#SingleApplicationClient.__init__">SingleApplicationClient</a></td> |
76 <td><a href="#SingleApplicationClient.__init__">SingleApplicationClient</a></td> |
64 <td>Constructor</td> |
77 <td>Constructor</td> |
65 </tr><tr> |
78 </tr> |
|
79 <tr> |
66 <td><a href="#SingleApplicationClient.connect">connect</a></td> |
80 <td><a href="#SingleApplicationClient.connect">connect</a></td> |
67 <td>Public method to connect the single application client to its server.</td> |
81 <td>Public method to connect the single application client to its server.</td> |
68 </tr><tr> |
82 </tr> |
|
83 <tr> |
69 <td><a href="#SingleApplicationClient.disconnect">disconnect</a></td> |
84 <td><a href="#SingleApplicationClient.disconnect">disconnect</a></td> |
70 <td>Public method to disconnect from the Single Appliocation server.</td> |
85 <td>Public method to disconnect from the Single Appliocation server.</td> |
71 </tr><tr> |
86 </tr> |
|
87 <tr> |
72 <td><a href="#SingleApplicationClient.errstr">errstr</a></td> |
88 <td><a href="#SingleApplicationClient.errstr">errstr</a></td> |
73 <td>Public method to return a meaningful error string for the last error.</td> |
89 <td>Public method to return a meaningful error string for the last error.</td> |
74 </tr><tr> |
90 </tr> |
|
91 <tr> |
75 <td><a href="#SingleApplicationClient.processArgs">processArgs</a></td> |
92 <td><a href="#SingleApplicationClient.processArgs">processArgs</a></td> |
76 <td>Public method to process the command line args passed to the UI.</td> |
93 <td>Public method to process the command line args passed to the UI.</td> |
77 </tr><tr> |
94 </tr> |
|
95 <tr> |
78 <td><a href="#SingleApplicationClient.sendCommand">sendCommand</a></td> |
96 <td><a href="#SingleApplicationClient.sendCommand">sendCommand</a></td> |
79 <td>Public method to send the command to the application server.</td> |
97 <td>Public method to send the command to the application server.</td> |
80 </tr> |
98 </tr> |
81 </table> |
99 </table> |
82 <h3>Static Methods</h3> |
100 <h3>Static Methods</h3> |
83 <table> |
101 |
84 <tr><td>None</td></tr> |
102 <table> |
85 </table> |
103 <tr><td>None</td></tr> |
|
104 </table> |
|
105 |
86 <a NAME="SingleApplicationClient.__init__" ID="SingleApplicationClient.__init__"></a> |
106 <a NAME="SingleApplicationClient.__init__" ID="SingleApplicationClient.__init__"></a> |
87 <h4>SingleApplicationClient (Constructor)</h4> |
107 <h4>SingleApplicationClient (Constructor)</h4> |
88 <b>SingleApplicationClient</b>(<i>name</i>) |
108 <b>SingleApplicationClient</b>(<i>name</i>) |
|
109 |
89 <p> |
110 <p> |
90 Constructor |
111 Constructor |
91 </p><dl> |
112 </p> |
|
113 <dl> |
|
114 |
92 <dt><i>name</i></dt> |
115 <dt><i>name</i></dt> |
93 <dd> |
116 <dd> |
94 name of the local server to connect to (string) |
117 name of the local server to connect to (string) |
95 </dd> |
118 </dd> |
96 </dl><a NAME="SingleApplicationClient.connect" ID="SingleApplicationClient.connect"></a> |
119 </dl> |
|
120 <a NAME="SingleApplicationClient.connect" ID="SingleApplicationClient.connect"></a> |
97 <h4>SingleApplicationClient.connect</h4> |
121 <h4>SingleApplicationClient.connect</h4> |
98 <b>connect</b>(<i>timeout=10000</i>) |
122 <b>connect</b>(<i>timeout=10000</i>) |
|
123 |
99 <p> |
124 <p> |
100 Public method to connect the single application client to its server. |
125 Public method to connect the single application client to its server. |
101 </p><dl> |
126 </p> |
|
127 <dl> |
|
128 |
102 <dt><i>timeout</i> (int)</dt> |
129 <dt><i>timeout</i> (int)</dt> |
103 <dd> |
130 <dd> |
104 connection timeout value in milliseconds |
131 connection timeout value in milliseconds |
105 </dd> |
132 </dd> |
106 </dl><dl> |
133 </dl> |
|
134 <dl> |
107 <dt>Returns:</dt> |
135 <dt>Returns:</dt> |
108 <dd> |
136 <dd> |
109 value indicating success or an error number. Value is one of: |
137 value indicating success or an error number. Value is one of: |
110 <table> |
138 <table> |
111 <tr><td>0</td><td>No application is running</td></tr> |
139 <tr><td>0</td><td>No application is running</td></tr> |
112 <tr><td>1</td><td>Application is already running</td></tr> |
140 <tr><td>1</td><td>Application is already running</td></tr> |
113 </table> |
141 </table> |
114 </dd> |
142 </dd> |
115 </dl><a NAME="SingleApplicationClient.disconnect" ID="SingleApplicationClient.disconnect"></a> |
143 </dl> |
|
144 <a NAME="SingleApplicationClient.disconnect" ID="SingleApplicationClient.disconnect"></a> |
116 <h4>SingleApplicationClient.disconnect</h4> |
145 <h4>SingleApplicationClient.disconnect</h4> |
117 <b>disconnect</b>(<i></i>) |
146 <b>disconnect</b>(<i></i>) |
|
147 |
118 <p> |
148 <p> |
119 Public method to disconnect from the Single Appliocation server. |
149 Public method to disconnect from the Single Appliocation server. |
120 </p><a NAME="SingleApplicationClient.errstr" ID="SingleApplicationClient.errstr"></a> |
150 </p> |
|
151 <a NAME="SingleApplicationClient.errstr" ID="SingleApplicationClient.errstr"></a> |
121 <h4>SingleApplicationClient.errstr</h4> |
152 <h4>SingleApplicationClient.errstr</h4> |
122 <b>errstr</b>(<i></i>) |
153 <b>errstr</b>(<i></i>) |
|
154 |
123 <p> |
155 <p> |
124 Public method to return a meaningful error string for the last error. |
156 Public method to return a meaningful error string for the last error. |
125 </p><dl> |
157 </p> |
|
158 <dl> |
126 <dt>Returns:</dt> |
159 <dt>Returns:</dt> |
127 <dd> |
160 <dd> |
128 error string for the last error (string) |
161 error string for the last error (string) |
129 </dd> |
162 </dd> |
130 </dl><a NAME="SingleApplicationClient.processArgs" ID="SingleApplicationClient.processArgs"></a> |
163 </dl> |
|
164 <a NAME="SingleApplicationClient.processArgs" ID="SingleApplicationClient.processArgs"></a> |
131 <h4>SingleApplicationClient.processArgs</h4> |
165 <h4>SingleApplicationClient.processArgs</h4> |
132 <b>processArgs</b>(<i>args</i>) |
166 <b>processArgs</b>(<i>args</i>) |
|
167 |
133 <p> |
168 <p> |
134 Public method to process the command line args passed to the UI. |
169 Public method to process the command line args passed to the UI. |
135 </p><p> |
170 </p> |
|
171 <p> |
136 <b>Note</b>: This method must be overridden by subclasses. |
172 <b>Note</b>: This method must be overridden by subclasses. |
137 </p><dl> |
173 </p> |
|
174 <dl> |
|
175 |
138 <dt><i>args</i></dt> |
176 <dt><i>args</i></dt> |
139 <dd> |
177 <dd> |
140 command line args (list of strings) |
178 command line args (list of strings) |
141 </dd> |
179 </dd> |
142 </dl><dl> |
180 </dl> |
|
181 <dl> |
|
182 |
143 <dt>Raises <b>RuntimeError</b>:</dt> |
183 <dt>Raises <b>RuntimeError</b>:</dt> |
144 <dd> |
184 <dd> |
145 raised to indicate that this method must be |
185 raised to indicate that this method must be |
146 implemented by a subclass |
186 implemented by a subclass |
147 </dd> |
187 </dd> |
148 </dl><a NAME="SingleApplicationClient.sendCommand" ID="SingleApplicationClient.sendCommand"></a> |
188 </dl> |
|
189 <a NAME="SingleApplicationClient.sendCommand" ID="SingleApplicationClient.sendCommand"></a> |
149 <h4>SingleApplicationClient.sendCommand</h4> |
190 <h4>SingleApplicationClient.sendCommand</h4> |
150 <b>sendCommand</b>(<i>command, arguments</i>) |
191 <b>sendCommand</b>(<i>command, arguments</i>) |
|
192 |
151 <p> |
193 <p> |
152 Public method to send the command to the application server. |
194 Public method to send the command to the application server. |
153 </p><dl> |
195 </p> |
|
196 <dl> |
|
197 |
154 <dt><i>command</i> (str)</dt> |
198 <dt><i>command</i> (str)</dt> |
155 <dd> |
199 <dd> |
156 command to be sent to the server |
200 command to be sent to the server |
157 </dd><dt><i>arguments</i> (list of str)</dt> |
201 </dd> |
|
202 <dt><i>arguments</i> (list of str)</dt> |
158 <dd> |
203 <dd> |
159 list of command arguments |
204 list of command arguments |
160 </dd> |
205 </dd> |
161 </dl> |
206 </dl> |
162 <div align="right"><a href="#top">Up</a></div> |
207 <div align="right"><a href="#top">Up</a></div> |
163 <hr /><hr /> |
208 <hr /> |
|
209 <hr /> |
164 <a NAME="SingleApplicationServer" ID="SingleApplicationServer"></a> |
210 <a NAME="SingleApplicationServer" ID="SingleApplicationServer"></a> |
165 <h2>SingleApplicationServer</h2> |
211 <h2>SingleApplicationServer</h2> |
|
212 |
166 <p> |
213 <p> |
167 Class implementing the single application server base class. |
214 Class implementing the single application server base class. |
168 </p> |
215 </p> |
169 <h3>Derived from</h3> |
216 <h3>Derived from</h3> |
170 QLocalServer |
217 QLocalServer |
171 <h3>Class Attributes</h3> |
218 <h3>Class Attributes</h3> |
|
219 |
172 <table> |
220 <table> |
173 <tr><td>None</td></tr> |
221 <tr><td>None</td></tr> |
174 </table> |
222 </table> |
175 <h3>Class Methods</h3> |
223 <h3>Class Methods</h3> |
|
224 |
176 <table> |
225 <table> |
177 <tr><td>None</td></tr> |
226 <tr><td>None</td></tr> |
178 </table> |
227 </table> |
179 <h3>Methods</h3> |
228 <h3>Methods</h3> |
180 <table> |
229 |
|
230 <table> |
|
231 |
181 <tr> |
232 <tr> |
182 <td><a href="#SingleApplicationServer.__init__">SingleApplicationServer</a></td> |
233 <td><a href="#SingleApplicationServer.__init__">SingleApplicationServer</a></td> |
183 <td>Constructor</td> |
234 <td>Constructor</td> |
184 </tr><tr> |
235 </tr> |
|
236 <tr> |
185 <td><a href="#SingleApplicationServer.__disconnected">__disconnected</a></td> |
237 <td><a href="#SingleApplicationServer.__disconnected">__disconnected</a></td> |
186 <td>Private method to handle the closure of the socket.</td> |
238 <td>Private method to handle the closure of the socket.</td> |
187 </tr><tr> |
239 </tr> |
|
240 <tr> |
188 <td><a href="#SingleApplicationServer.__newConnection">__newConnection</a></td> |
241 <td><a href="#SingleApplicationServer.__newConnection">__newConnection</a></td> |
189 <td>Private slot to handle a new connection.</td> |
242 <td>Private slot to handle a new connection.</td> |
190 </tr><tr> |
243 </tr> |
|
244 <tr> |
191 <td><a href="#SingleApplicationServer.__receiveJson">__receiveJson</a></td> |
245 <td><a href="#SingleApplicationServer.__receiveJson">__receiveJson</a></td> |
192 <td>Private method to receive the data from the client.</td> |
246 <td>Private method to receive the data from the client.</td> |
193 </tr><tr> |
247 </tr> |
|
248 <tr> |
194 <td><a href="#SingleApplicationServer.handleCommand">handleCommand</a></td> |
249 <td><a href="#SingleApplicationServer.handleCommand">handleCommand</a></td> |
195 <td>Public slot to handle the command sent by the client.</td> |
250 <td>Public slot to handle the command sent by the client.</td> |
196 </tr><tr> |
251 </tr> |
|
252 <tr> |
197 <td><a href="#SingleApplicationServer.shutdown">shutdown</a></td> |
253 <td><a href="#SingleApplicationServer.shutdown">shutdown</a></td> |
198 <td>Public method used to shut down the server.</td> |
254 <td>Public method used to shut down the server.</td> |
199 </tr> |
255 </tr> |
200 </table> |
256 </table> |
201 <h3>Static Methods</h3> |
257 <h3>Static Methods</h3> |
202 <table> |
258 |
203 <tr><td>None</td></tr> |
259 <table> |
204 </table> |
260 <tr><td>None</td></tr> |
|
261 </table> |
|
262 |
205 <a NAME="SingleApplicationServer.__init__" ID="SingleApplicationServer.__init__"></a> |
263 <a NAME="SingleApplicationServer.__init__" ID="SingleApplicationServer.__init__"></a> |
206 <h4>SingleApplicationServer (Constructor)</h4> |
264 <h4>SingleApplicationServer (Constructor)</h4> |
207 <b>SingleApplicationServer</b>(<i>name</i>) |
265 <b>SingleApplicationServer</b>(<i>name</i>) |
|
266 |
208 <p> |
267 <p> |
209 Constructor |
268 Constructor |
210 </p><dl> |
269 </p> |
|
270 <dl> |
|
271 |
211 <dt><i>name</i></dt> |
272 <dt><i>name</i></dt> |
212 <dd> |
273 <dd> |
213 name this server is listening to (string) |
274 name this server is listening to (string) |
214 </dd> |
275 </dd> |
215 </dl><a NAME="SingleApplicationServer.__disconnected" ID="SingleApplicationServer.__disconnected"></a> |
276 </dl> |
|
277 <a NAME="SingleApplicationServer.__disconnected" ID="SingleApplicationServer.__disconnected"></a> |
216 <h4>SingleApplicationServer.__disconnected</h4> |
278 <h4>SingleApplicationServer.__disconnected</h4> |
217 <b>__disconnected</b>(<i></i>) |
279 <b>__disconnected</b>(<i></i>) |
|
280 |
218 <p> |
281 <p> |
219 Private method to handle the closure of the socket. |
282 Private method to handle the closure of the socket. |
220 </p><a NAME="SingleApplicationServer.__newConnection" ID="SingleApplicationServer.__newConnection"></a> |
283 </p> |
|
284 <a NAME="SingleApplicationServer.__newConnection" ID="SingleApplicationServer.__newConnection"></a> |
221 <h4>SingleApplicationServer.__newConnection</h4> |
285 <h4>SingleApplicationServer.__newConnection</h4> |
222 <b>__newConnection</b>(<i></i>) |
286 <b>__newConnection</b>(<i></i>) |
|
287 |
223 <p> |
288 <p> |
224 Private slot to handle a new connection. |
289 Private slot to handle a new connection. |
225 </p><a NAME="SingleApplicationServer.__receiveJson" ID="SingleApplicationServer.__receiveJson"></a> |
290 </p> |
|
291 <a NAME="SingleApplicationServer.__receiveJson" ID="SingleApplicationServer.__receiveJson"></a> |
226 <h4>SingleApplicationServer.__receiveJson</h4> |
292 <h4>SingleApplicationServer.__receiveJson</h4> |
227 <b>__receiveJson</b>(<i></i>) |
293 <b>__receiveJson</b>(<i></i>) |
|
294 |
228 <p> |
295 <p> |
229 Private method to receive the data from the client. |
296 Private method to receive the data from the client. |
230 </p><a NAME="SingleApplicationServer.handleCommand" ID="SingleApplicationServer.handleCommand"></a> |
297 </p> |
|
298 <a NAME="SingleApplicationServer.handleCommand" ID="SingleApplicationServer.handleCommand"></a> |
231 <h4>SingleApplicationServer.handleCommand</h4> |
299 <h4>SingleApplicationServer.handleCommand</h4> |
232 <b>handleCommand</b>(<i>command, arguments</i>) |
300 <b>handleCommand</b>(<i>command, arguments</i>) |
|
301 |
233 <p> |
302 <p> |
234 Public slot to handle the command sent by the client. |
303 Public slot to handle the command sent by the client. |
235 </p><p> |
304 </p> |
|
305 <p> |
236 <b>Note</b>: This method must be overridden by subclasses. |
306 <b>Note</b>: This method must be overridden by subclasses. |
237 </p><dl> |
307 </p> |
|
308 <dl> |
|
309 |
238 <dt><i>command</i> (str)</dt> |
310 <dt><i>command</i> (str)</dt> |
239 <dd> |
311 <dd> |
240 command sent by the client |
312 command sent by the client |
241 </dd><dt><i>arguments</i> (list of str)</dt> |
313 </dd> |
|
314 <dt><i>arguments</i> (list of str)</dt> |
242 <dd> |
315 <dd> |
243 list of command arguments |
316 list of command arguments |
244 </dd> |
317 </dd> |
245 </dl><dl> |
318 </dl> |
|
319 <dl> |
|
320 |
246 <dt>Raises <b>RuntimeError</b>:</dt> |
321 <dt>Raises <b>RuntimeError</b>:</dt> |
247 <dd> |
322 <dd> |
248 raised to indicate that this method must be |
323 raised to indicate that this method must be |
249 implemented by a subclass |
324 implemented by a subclass |
250 </dd> |
325 </dd> |
251 </dl><a NAME="SingleApplicationServer.shutdown" ID="SingleApplicationServer.shutdown"></a> |
326 </dl> |
|
327 <a NAME="SingleApplicationServer.shutdown" ID="SingleApplicationServer.shutdown"></a> |
252 <h4>SingleApplicationServer.shutdown</h4> |
328 <h4>SingleApplicationServer.shutdown</h4> |
253 <b>shutdown</b>(<i></i>) |
329 <b>shutdown</b>(<i></i>) |
|
330 |
254 <p> |
331 <p> |
255 Public method used to shut down the server. |
332 Public method used to shut down the server. |
256 </p> |
333 </p> |
257 <div align="right"><a href="#top">Up</a></div> |
334 <div align="right"><a href="#top">Up</a></div> |
258 <hr /> |
335 <hr /> |