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'>
5
<title>eric4.Utilities.SingleApplication</title>
9
margin: 0em 1em 10em 1em;
13
h1 { color: white; background: #4FA4FF; }
14
h2 { color: white; background: #4FA4FF; }
15
h3 { color: white; background: #00557F; }
16
h4 { color: white; background: #00557F; }
22
<body><a NAME="top" ID="top"></a>
23
<h1>eric4.Utilities.SingleApplication</h1>
25
Module implementing the single application server and client.
30
<td><a href="#SingleApplicationClient">SingleApplicationClient</a></td>
31
<td>Class implementing the single application client base class.</td>
33
<td><a href="#SingleApplicationServer">SingleApplicationServer</a></td>
34
<td>Class implementing the single application server base class.</td>
39
<tr><td>None</td></tr>
42
<a NAME="SingleApplicationClient" ID="SingleApplicationClient"></a>
43
<h2>SingleApplicationClient</h2>
45
Class implementing the single application client base class.
52
<td><a href="#SingleApplicationClient.__init__">SingleApplicationClient</a></td>
55
<td><a href="#SingleApplicationClient.connect">connect</a></td>
56
<td>Public method to connect the single application client to its server.</td>
58
<td><a href="#SingleApplicationClient.disconnect">disconnect</a></td>
59
<td>Public method to disconnect from the Single Appliocation server.</td>
61
<td><a href="#SingleApplicationClient.errstr">errstr</a></td>
62
<td>Public method to return a meaningful error string for the last error.</td>
64
<td><a href="#SingleApplicationClient.processArgs">processArgs</a></td>
65
<td>Public method to process the command line args passed to the UI.</td>
67
<td><a href="#SingleApplicationClient.sendCommand">sendCommand</a></td>
68
<td>Public method to send the command to the application server.</td>
71
<p><a NAME="SingleApplicationClient.__init__" ID="SingleApplicationClient.__init__"></a>
72
<h4>SingleApplicationClient (Constructor)</h4>
73
<b>SingleApplicationClient</b>(<i>pidFile</i>)
77
<dt><i>pidFile</i></dt>
79
filename of the PID file used to get some interface
82
</dl><a NAME="SingleApplicationClient.connect" ID="SingleApplicationClient.connect"></a>
83
<h4>SingleApplicationClient.connect</h4>
84
<b>connect</b>(<i></i>)
86
Public method to connect the single application client to its server.
90
value indicating success or an error number. Value is one of:
92
<tr><td>0</td><td>No application is running</td></tr>
93
<tr><td>1</td><td>Application is already running</td></tr>
94
<tr><td>-1</td><td>The lock file could not be read</td></tr>
95
<tr><td>-2</td><td>The lock file is corrupt</td></tr>
98
</dl><a NAME="SingleApplicationClient.disconnect" ID="SingleApplicationClient.disconnect"></a>
99
<h4>SingleApplicationClient.disconnect</h4>
100
<b>disconnect</b>(<i></i>)
102
Public method to disconnect from the Single Appliocation server.
103
</p><a NAME="SingleApplicationClient.errstr" ID="SingleApplicationClient.errstr"></a>
104
<h4>SingleApplicationClient.errstr</h4>
105
<b>errstr</b>(<i></i>)
107
Public method to return a meaningful error string for the last error.
111
error string for the last error (string)
113
</dl><a NAME="SingleApplicationClient.processArgs" ID="SingleApplicationClient.processArgs"></a>
114
<h4>SingleApplicationClient.processArgs</h4>
115
<b>processArgs</b>(<i>args</i>)
117
Public method to process the command line args passed to the UI.
119
<b>Note</b>: This method must be overridden by subclasses.
123
command line args (list of strings)
125
</dl><a NAME="SingleApplicationClient.sendCommand" ID="SingleApplicationClient.sendCommand"></a>
126
<h4>SingleApplicationClient.sendCommand</h4>
127
<b>sendCommand</b>(<i>cmd</i>)
129
Public method to send the command to the application server.
133
command to be sent (string)
136
<div align="right"><a href="#top">Up</a></div>
138
<a NAME="SingleApplicationServer" ID="SingleApplicationServer"></a>
139
<h2>SingleApplicationServer</h2>
141
Class implementing the single application server base class.
143
<h3>Derived from</h3>
148
<td><a href="#SingleApplicationServer.__init__">SingleApplicationServer</a></td>
151
<td><a href="#SingleApplicationServer.__disconnected">__disconnected</a></td>
152
<td>Private method to handle the closure of the socket.</td>
154
<td><a href="#SingleApplicationServer.__newConnection">__newConnection</a></td>
155
<td>Private slot to handle a new connection.</td>
157
<td><a href="#SingleApplicationServer.__parseLine">__parseLine</a></td>
158
<td>Private method to handle data from the client.</td>
160
<td><a href="#SingleApplicationServer.handleCommand">handleCommand</a></td>
161
<td>Public slot to handle the command sent by the client.</td>
163
<td><a href="#SingleApplicationServer.shutdown">shutdown</a></td>
164
<td>Public method used to shut down the server.</td>
167
<p><a NAME="SingleApplicationServer.__init__" ID="SingleApplicationServer.__init__"></a>
168
<h4>SingleApplicationServer (Constructor)</h4>
169
<b>SingleApplicationServer</b>(<i>pidFile</i>)
173
<dt><i>pidFile</i></dt>
175
filename of the PID file used to record some interface
178
</dl><a NAME="SingleApplicationServer.__disconnected" ID="SingleApplicationServer.__disconnected"></a>
179
<h4>SingleApplicationServer.__disconnected</h4>
180
<b>__disconnected</b>(<i></i>)
182
Private method to handle the closure of the socket.
183
</p><a NAME="SingleApplicationServer.__newConnection" ID="SingleApplicationServer.__newConnection"></a>
184
<h4>SingleApplicationServer.__newConnection</h4>
185
<b>__newConnection</b>(<i></i>)
187
Private slot to handle a new connection.
188
</p><a NAME="SingleApplicationServer.__parseLine" ID="SingleApplicationServer.__parseLine"></a>
189
<h4>SingleApplicationServer.__parseLine</h4>
190
<b>__parseLine</b>(<i></i>)
192
Private method to handle data from the client.
193
</p><a NAME="SingleApplicationServer.handleCommand" ID="SingleApplicationServer.handleCommand"></a>
194
<h4>SingleApplicationServer.handleCommand</h4>
195
<b>handleCommand</b>(<i>cmd, params</i>)
197
Public slot to handle the command sent by the client.
199
<b>Note</b>: This method must be overridden by subclasses.
203
commandstring (string)
204
</dd><dt><i>params</i></dt>
206
parameterstring (string)
208
</dl><a NAME="SingleApplicationServer.shutdown" ID="SingleApplicationServer.shutdown"></a>
209
<h4>SingleApplicationServer.shutdown</h4>
210
<b>shutdown</b>(<i></i>)
212
Public method used to shut down the server.
214
<div align="right"><a href="#top">Up</a></div>
b'\\ No newline at end of file'