ipc: Pass socket to send_to_running_instance.
This commit is contained in:
parent
82c647a87d
commit
e0c6a322c6
@ -259,7 +259,7 @@ def _socket_error(action, socket):
|
|||||||
action, socket.errorString(), socket.error()))
|
action, socket.errorString(), socket.error()))
|
||||||
|
|
||||||
|
|
||||||
def send_to_running_instance(socketname, command):
|
def send_to_running_instance(socketname, command, *, socket=None):
|
||||||
"""Try to send a commandline to a running instance.
|
"""Try to send a commandline to a running instance.
|
||||||
|
|
||||||
Blocks for CONNECT_TIMEOUT ms.
|
Blocks for CONNECT_TIMEOUT ms.
|
||||||
@ -267,10 +267,12 @@ def send_to_running_instance(socketname, command):
|
|||||||
Args:
|
Args:
|
||||||
socketname: The name which should be used for the socket.
|
socketname: The name which should be used for the socket.
|
||||||
command: The command to send to the running instance.
|
command: The command to send to the running instance.
|
||||||
|
socket: The socket to read data from, or None.
|
||||||
|
|
||||||
Return:
|
Return:
|
||||||
True if connecting was successful, False if no connection was made.
|
True if connecting was successful, False if no connection was made.
|
||||||
"""
|
"""
|
||||||
|
if socket is None:
|
||||||
socket = QLocalSocket()
|
socket = QLocalSocket()
|
||||||
log.ipc.debug("Connecting to {}".format(socketname))
|
log.ipc.debug("Connecting to {}".format(socketname))
|
||||||
socket.connectToServer(socketname)
|
socket.connectToServer(socketname)
|
||||||
|
Loading…
Reference in New Issue
Block a user