20 </style> |
20 </style> |
21 </head> |
21 </head> |
22 <body><a NAME="top" ID="top"></a> |
22 <body><a NAME="top" ID="top"></a> |
23 <h1>eric5.Utilities.SingleApplication</h1> |
23 <h1>eric5.Utilities.SingleApplication</h1> |
24 <p> |
24 <p> |
25 Module implementing the single application server and client. |
25 Module implementing the single application server and client. |
26 </p> |
26 </p> |
27 <h3>Global Attributes</h3> |
27 <h3>Global Attributes</h3> |
28 <table> |
28 <table> |
29 <tr><td>None</td></tr> |
29 <tr><td>None</td></tr> |
30 </table> |
30 </table> |
31 <h3>Classes</h3> |
31 <h3>Classes</h3> |
32 <table> |
32 <table> |
33 <tr> |
33 <tr> |
34 <td><a href="#SingleApplicationClient">SingleApplicationClient</a></td> |
34 <td><a href="#SingleApplicationClient">SingleApplicationClient</a></td> |
35 <td>Class implementing the single application client base class.</td> |
35 <td>Class implementing the single application client base class.</td> |
36 </tr><tr> |
36 </tr><tr> |
37 <td><a href="#SingleApplicationServer">SingleApplicationServer</a></td> |
37 <td><a href="#SingleApplicationServer">SingleApplicationServer</a></td> |
38 <td>Class implementing the single application server base class.</td> |
38 <td>Class implementing the single application server base class.</td> |
39 </tr> |
39 </tr> |
40 </table> |
40 </table> |
41 <h3>Functions</h3> |
41 <h3>Functions</h3> |
42 <table> |
42 <table> |
43 <tr><td>None</td></tr> |
43 <tr><td>None</td></tr> |
44 </table> |
44 </table> |
45 <hr /><hr /> |
45 <hr /><hr /> |
46 <a NAME="SingleApplicationClient" ID="SingleApplicationClient"></a> |
46 <a NAME="SingleApplicationClient" ID="SingleApplicationClient"></a> |
47 <h2>SingleApplicationClient</h2> |
47 <h2>SingleApplicationClient</h2> |
48 <p> |
48 <p> |
49 Class implementing the single application client base class. |
49 Class implementing the single application client base class. |
50 </p> |
50 </p> |
51 <h3>Derived from</h3> |
51 <h3>Derived from</h3> |
52 object |
52 object |
53 <h3>Class Attributes</h3> |
53 <h3>Class Attributes</h3> |
54 <table> |
54 <table> |
56 </table> |
56 </table> |
57 <h3>Methods</h3> |
57 <h3>Methods</h3> |
58 <table> |
58 <table> |
59 <tr> |
59 <tr> |
60 <td><a href="#SingleApplicationClient.__init__">SingleApplicationClient</a></td> |
60 <td><a href="#SingleApplicationClient.__init__">SingleApplicationClient</a></td> |
61 <td>Constructor</td> |
61 <td>Constructor</td> |
62 </tr><tr> |
62 </tr><tr> |
63 <td><a href="#SingleApplicationClient.connect">connect</a></td> |
63 <td><a href="#SingleApplicationClient.connect">connect</a></td> |
64 <td>Public method to connect the single application client to its server.</td> |
64 <td>Public method to connect the single application client to its server.</td> |
65 </tr><tr> |
65 </tr><tr> |
66 <td><a href="#SingleApplicationClient.disconnect">disconnect</a></td> |
66 <td><a href="#SingleApplicationClient.disconnect">disconnect</a></td> |
67 <td>Public method to disconnect from the Single Appliocation server.</td> |
67 <td>Public method to disconnect from the Single Appliocation server.</td> |
68 </tr><tr> |
68 </tr><tr> |
69 <td><a href="#SingleApplicationClient.errstr">errstr</a></td> |
69 <td><a href="#SingleApplicationClient.errstr">errstr</a></td> |
70 <td>Public method to return a meaningful error string for the last error.</td> |
70 <td>Public method to return a meaningful error string for the last error.</td> |
71 </tr><tr> |
71 </tr><tr> |
72 <td><a href="#SingleApplicationClient.processArgs">processArgs</a></td> |
72 <td><a href="#SingleApplicationClient.processArgs">processArgs</a></td> |
73 <td>Public method to process the command line args passed to the UI.</td> |
73 <td>Public method to process the command line args passed to the UI.</td> |
74 </tr><tr> |
74 </tr><tr> |
75 <td><a href="#SingleApplicationClient.sendCommand">sendCommand</a></td> |
75 <td><a href="#SingleApplicationClient.sendCommand">sendCommand</a></td> |
76 <td>Public method to send the command to the application server.</td> |
76 <td>Public method to send the command to the application server.</td> |
77 </tr> |
77 </tr> |
78 </table> |
78 </table> |
79 <a NAME="SingleApplicationClient.__init__" ID="SingleApplicationClient.__init__"></a> |
79 <a NAME="SingleApplicationClient.__init__" ID="SingleApplicationClient.__init__"></a> |
80 <h4>SingleApplicationClient (Constructor)</h4> |
80 <h4>SingleApplicationClient (Constructor)</h4> |
81 <b>SingleApplicationClient</b>(<i>name</i>) |
81 <b>SingleApplicationClient</b>(<i>name</i>) |
82 <p> |
82 <p> |
83 Constructor |
83 Constructor |
84 </p><dl> |
84 </p><dl> |
85 <dt><i>name</i></dt> |
85 <dt><i>name</i></dt> |
86 <dd> |
86 <dd> |
87 name of the local server to connect to (string) |
87 name of the local server to connect to (string) |
88 </dd> |
88 </dd> |
89 </dl><a NAME="SingleApplicationClient.connect" ID="SingleApplicationClient.connect"></a> |
89 </dl><a NAME="SingleApplicationClient.connect" ID="SingleApplicationClient.connect"></a> |
90 <h4>SingleApplicationClient.connect</h4> |
90 <h4>SingleApplicationClient.connect</h4> |
91 <b>connect</b>(<i></i>) |
91 <b>connect</b>(<i></i>) |
92 <p> |
92 <p> |
93 Public method to connect the single application client to its server. |
93 Public method to connect the single application client to its server. |
94 </p><dl> |
94 </p><dl> |
95 <dt>Returns:</dt> |
95 <dt>Returns:</dt> |
96 <dd> |
96 <dd> |
97 value indicating success or an error number. Value is one of: |
97 value indicating success or an error number. Value is one of: |
98 <table> |
98 <table> |
99 <tr><td>0</td><td>No application is running</td></tr> |
99 <tr><td>0</td><td>No application is running</td></tr> |
100 <tr><td>1</td><td>Application is already running</td></tr> |
100 <tr><td>1</td><td>Application is already running</td></tr> |
101 </table> |
101 </table> |
102 </dd> |
102 </dd> |
103 </dl><a NAME="SingleApplicationClient.disconnect" ID="SingleApplicationClient.disconnect"></a> |
103 </dl><a NAME="SingleApplicationClient.disconnect" ID="SingleApplicationClient.disconnect"></a> |
104 <h4>SingleApplicationClient.disconnect</h4> |
104 <h4>SingleApplicationClient.disconnect</h4> |
105 <b>disconnect</b>(<i></i>) |
105 <b>disconnect</b>(<i></i>) |
106 <p> |
106 <p> |
107 Public method to disconnect from the Single Appliocation server. |
107 Public method to disconnect from the Single Appliocation server. |
108 </p><a NAME="SingleApplicationClient.errstr" ID="SingleApplicationClient.errstr"></a> |
108 </p><a NAME="SingleApplicationClient.errstr" ID="SingleApplicationClient.errstr"></a> |
109 <h4>SingleApplicationClient.errstr</h4> |
109 <h4>SingleApplicationClient.errstr</h4> |
110 <b>errstr</b>(<i></i>) |
110 <b>errstr</b>(<i></i>) |
111 <p> |
111 <p> |
112 Public method to return a meaningful error string for the last error. |
112 Public method to return a meaningful error string for the last error. |
113 </p><dl> |
113 </p><dl> |
114 <dt>Returns:</dt> |
114 <dt>Returns:</dt> |
115 <dd> |
115 <dd> |
116 error string for the last error (string) |
116 error string for the last error (string) |
117 </dd> |
117 </dd> |
118 </dl><a NAME="SingleApplicationClient.processArgs" ID="SingleApplicationClient.processArgs"></a> |
118 </dl><a NAME="SingleApplicationClient.processArgs" ID="SingleApplicationClient.processArgs"></a> |
119 <h4>SingleApplicationClient.processArgs</h4> |
119 <h4>SingleApplicationClient.processArgs</h4> |
120 <b>processArgs</b>(<i>args</i>) |
120 <b>processArgs</b>(<i>args</i>) |
121 <p> |
121 <p> |
122 Public method to process the command line args passed to the UI. |
122 Public method to process the command line args passed to the UI. |
123 </p><p> |
123 </p><p> |
124 <b>Note</b>: This method must be overridden by subclasses. |
124 <b>Note</b>: This method must be overridden by subclasses. |
125 </p><dl> |
125 </p><dl> |
126 <dt><i>args</i></dt> |
126 <dt><i>args</i></dt> |
127 <dd> |
127 <dd> |
128 command line args (list of strings) |
128 command line args (list of strings) |
129 </dd> |
129 </dd> |
130 </dl><a NAME="SingleApplicationClient.sendCommand" ID="SingleApplicationClient.sendCommand"></a> |
130 </dl><a NAME="SingleApplicationClient.sendCommand" ID="SingleApplicationClient.sendCommand"></a> |
131 <h4>SingleApplicationClient.sendCommand</h4> |
131 <h4>SingleApplicationClient.sendCommand</h4> |
132 <b>sendCommand</b>(<i>cmd</i>) |
132 <b>sendCommand</b>(<i>cmd</i>) |
133 <p> |
133 <p> |
134 Public method to send the command to the application server. |
134 Public method to send the command to the application server. |
135 </p><dl> |
135 </p><dl> |
136 <dt><i>cmd</i></dt> |
136 <dt><i>cmd</i></dt> |
137 <dd> |
137 <dd> |
138 command to be sent (string) |
138 command to be sent (string) |
139 </dd> |
139 </dd> |
140 </dl> |
140 </dl> |
141 <div align="right"><a href="#top">Up</a></div> |
141 <div align="right"><a href="#top">Up</a></div> |
142 <hr /><hr /> |
142 <hr /><hr /> |
143 <a NAME="SingleApplicationServer" ID="SingleApplicationServer"></a> |
143 <a NAME="SingleApplicationServer" ID="SingleApplicationServer"></a> |
144 <h2>SingleApplicationServer</h2> |
144 <h2>SingleApplicationServer</h2> |
145 <p> |
145 <p> |
146 Class implementing the single application server base class. |
146 Class implementing the single application server base class. |
147 </p> |
147 </p> |
148 <h3>Derived from</h3> |
148 <h3>Derived from</h3> |
149 QLocalServer |
149 QLocalServer |
150 <h3>Class Attributes</h3> |
150 <h3>Class Attributes</h3> |
151 <table> |
151 <table> |
153 </table> |
153 </table> |
154 <h3>Methods</h3> |
154 <h3>Methods</h3> |
155 <table> |
155 <table> |
156 <tr> |
156 <tr> |
157 <td><a href="#SingleApplicationServer.__init__">SingleApplicationServer</a></td> |
157 <td><a href="#SingleApplicationServer.__init__">SingleApplicationServer</a></td> |
158 <td>Constructor</td> |
158 <td>Constructor</td> |
159 </tr><tr> |
159 </tr><tr> |
160 <td><a href="#SingleApplicationServer.__disconnected">__disconnected</a></td> |
160 <td><a href="#SingleApplicationServer.__disconnected">__disconnected</a></td> |
161 <td>Private method to handle the closure of the socket.</td> |
161 <td>Private method to handle the closure of the socket.</td> |
162 </tr><tr> |
162 </tr><tr> |
163 <td><a href="#SingleApplicationServer.__newConnection">__newConnection</a></td> |
163 <td><a href="#SingleApplicationServer.__newConnection">__newConnection</a></td> |
164 <td>Private slot to handle a new connection.</td> |
164 <td>Private slot to handle a new connection.</td> |
165 </tr><tr> |
165 </tr><tr> |
166 <td><a href="#SingleApplicationServer.__parseLine">__parseLine</a></td> |
166 <td><a href="#SingleApplicationServer.__parseLine">__parseLine</a></td> |
167 <td>Private method to handle data from the client.</td> |
167 <td>Private method to handle data from the client.</td> |
168 </tr><tr> |
168 </tr><tr> |
169 <td><a href="#SingleApplicationServer.handleCommand">handleCommand</a></td> |
169 <td><a href="#SingleApplicationServer.handleCommand">handleCommand</a></td> |
170 <td>Public slot to handle the command sent by the client.</td> |
170 <td>Public slot to handle the command sent by the client.</td> |
171 </tr><tr> |
171 </tr><tr> |
172 <td><a href="#SingleApplicationServer.shutdown">shutdown</a></td> |
172 <td><a href="#SingleApplicationServer.shutdown">shutdown</a></td> |
173 <td>Public method used to shut down the server.</td> |
173 <td>Public method used to shut down the server.</td> |
174 </tr> |
174 </tr> |
175 </table> |
175 </table> |
176 <a NAME="SingleApplicationServer.__init__" ID="SingleApplicationServer.__init__"></a> |
176 <a NAME="SingleApplicationServer.__init__" ID="SingleApplicationServer.__init__"></a> |
177 <h4>SingleApplicationServer (Constructor)</h4> |
177 <h4>SingleApplicationServer (Constructor)</h4> |
178 <b>SingleApplicationServer</b>(<i>name</i>) |
178 <b>SingleApplicationServer</b>(<i>name</i>) |
179 <p> |
179 <p> |
180 Constructor |
180 Constructor |
181 </p><dl> |
181 </p><dl> |
182 <dt><i>name</i></dt> |
182 <dt><i>name</i></dt> |
183 <dd> |
183 <dd> |
184 name this server is listening to (string) |
184 name this server is listening to (string) |
185 </dd> |
185 </dd> |
186 </dl><a NAME="SingleApplicationServer.__disconnected" ID="SingleApplicationServer.__disconnected"></a> |
186 </dl><a NAME="SingleApplicationServer.__disconnected" ID="SingleApplicationServer.__disconnected"></a> |
187 <h4>SingleApplicationServer.__disconnected</h4> |
187 <h4>SingleApplicationServer.__disconnected</h4> |
188 <b>__disconnected</b>(<i></i>) |
188 <b>__disconnected</b>(<i></i>) |
189 <p> |
189 <p> |
190 Private method to handle the closure of the socket. |
190 Private method to handle the closure of the socket. |
191 </p><a NAME="SingleApplicationServer.__newConnection" ID="SingleApplicationServer.__newConnection"></a> |
191 </p><a NAME="SingleApplicationServer.__newConnection" ID="SingleApplicationServer.__newConnection"></a> |
192 <h4>SingleApplicationServer.__newConnection</h4> |
192 <h4>SingleApplicationServer.__newConnection</h4> |
193 <b>__newConnection</b>(<i></i>) |
193 <b>__newConnection</b>(<i></i>) |
194 <p> |
194 <p> |
195 Private slot to handle a new connection. |
195 Private slot to handle a new connection. |
196 </p><a NAME="SingleApplicationServer.__parseLine" ID="SingleApplicationServer.__parseLine"></a> |
196 </p><a NAME="SingleApplicationServer.__parseLine" ID="SingleApplicationServer.__parseLine"></a> |
197 <h4>SingleApplicationServer.__parseLine</h4> |
197 <h4>SingleApplicationServer.__parseLine</h4> |
198 <b>__parseLine</b>(<i></i>) |
198 <b>__parseLine</b>(<i></i>) |
199 <p> |
199 <p> |
200 Private method to handle data from the client. |
200 Private method to handle data from the client. |
201 </p><a NAME="SingleApplicationServer.handleCommand" ID="SingleApplicationServer.handleCommand"></a> |
201 </p><a NAME="SingleApplicationServer.handleCommand" ID="SingleApplicationServer.handleCommand"></a> |
202 <h4>SingleApplicationServer.handleCommand</h4> |
202 <h4>SingleApplicationServer.handleCommand</h4> |
203 <b>handleCommand</b>(<i>cmd, params</i>) |
203 <b>handleCommand</b>(<i>cmd, params</i>) |
204 <p> |
204 <p> |
205 Public slot to handle the command sent by the client. |
205 Public slot to handle the command sent by the client. |
206 </p><p> |
206 </p><p> |
207 <b>Note</b>: This method must be overridden by subclasses. |
207 <b>Note</b>: This method must be overridden by subclasses. |
208 </p><dl> |
208 </p><dl> |
209 <dt><i>cmd</i></dt> |
209 <dt><i>cmd</i></dt> |
210 <dd> |
210 <dd> |
211 commandstring (string) |
211 commandstring (string) |
212 </dd><dt><i>params</i></dt> |
212 </dd><dt><i>params</i></dt> |
213 <dd> |
213 <dd> |
214 parameterstring (string) |
214 parameterstring (string) |
215 </dd> |
215 </dd> |
216 </dl><a NAME="SingleApplicationServer.shutdown" ID="SingleApplicationServer.shutdown"></a> |
216 </dl><a NAME="SingleApplicationServer.shutdown" ID="SingleApplicationServer.shutdown"></a> |
217 <h4>SingleApplicationServer.shutdown</h4> |
217 <h4>SingleApplicationServer.shutdown</h4> |
218 <b>shutdown</b>(<i></i>) |
218 <b>shutdown</b>(<i></i>) |
219 <p> |
219 <p> |
220 Public method used to shut down the server. |
220 Public method used to shut down the server. |
221 </p> |
221 </p> |
222 <div align="right"><a href="#top">Up</a></div> |
222 <div align="right"><a href="#top">Up</a></div> |
223 <hr /> |
223 <hr /> |
224 </body></html> |
224 </body></html> |