Add PYQ control flag
This commit is contained in:
@@ -358,7 +358,7 @@ class Wcf():
|
||||
"""
|
||||
return self.msgQ.get(block, timeout=1)
|
||||
|
||||
def enable_receiving_msg(self) -> bool:
|
||||
def enable_receiving_msg(self, pyq=False) -> bool:
|
||||
"""允许接收消息,成功后通过 `get_msg` 读取消息"""
|
||||
def listening_msg():
|
||||
rsp = wcf_pb2.Response()
|
||||
@@ -379,13 +379,14 @@ class Wcf():
|
||||
|
||||
req = wcf_pb2.Request()
|
||||
req.func = wcf_pb2.FUNC_ENABLE_RECV_TXT # FUNC_ENABLE_RECV_TXT
|
||||
req.flag = pyq
|
||||
rsp = self._send_request(req)
|
||||
if rsp.status != 0:
|
||||
return False
|
||||
|
||||
self._is_receiving_msg = True
|
||||
# 阻塞,把控制权交给用户
|
||||
# self._rpc_get_message(callback)
|
||||
# self.listening_msg(callback)
|
||||
|
||||
# 不阻塞,启动一个新的线程来接收消息
|
||||
Thread(target=listening_msg, name="GetMessage", daemon=True).start()
|
||||
@@ -541,7 +542,6 @@ class Wcf():
|
||||
rsp = self._send_request(req)
|
||||
return rsp.status
|
||||
|
||||
|
||||
def decrypt_image(self, src: str, dst: str) -> bool:
|
||||
"""解密图片:
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user