Toolbox/SingleApplication.py

branch
maintenance
changeset 5776
49ba4a9f0421
parent 5389
9b1c800daff3
child 6048
82ad8ec9548c
equal deleted inserted replaced
5773:899700885725 5776:49ba4a9f0421
7 Module implementing the single application server and client. 7 Module implementing the single application server and client.
8 """ 8 """
9 9
10 from __future__ import unicode_literals 10 from __future__ import unicode_literals
11 11
12 from PyQt5.QtCore import QByteArray
12 from PyQt5.QtNetwork import QLocalServer, QLocalSocket 13 from PyQt5.QtNetwork import QLocalServer, QLocalSocket
13 14
14 15
15 class SingleApplicationServer(QLocalServer): 16 class SingleApplicationServer(QLocalServer):
16 """ 17 """
160 Public method to send the command to the application server. 161 Public method to send the command to the application server.
161 162
162 @param cmd command to be sent (string) 163 @param cmd command to be sent (string)
163 """ 164 """
164 if self.connected: 165 if self.connected:
165 self.sock.write(cmd) 166 self.sock.write(QByteArray(cmd.encode()))
166 self.sock.flush() 167 self.sock.flush()
167 168
168 def errstr(self): 169 def errstr(self):
169 """ 170 """
170 Public method to return a meaningful error string for the last error. 171 Public method to return a meaningful error string for the last error.

eric ide

mercurial