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