From 03ff8c9e2553bf1c1e352b699f8d6774e066f0bd Mon Sep 17 00:00:00 2001 From: Marquez <10957881+m4rque2@user.noreply.gitee.com> Date: Wed, 10 Jan 2024 08:14:45 +0000 Subject: [PATCH] =?UTF-8?q?update=20DrissionPage/=5Funits/listener.py.=20f?= =?UTF-8?q?ix=20a=20typo=20=E5=8F=82=E8=80=83=E4=BD=BF=E7=94=A8=E6=96=87?= =?UTF-8?q?=E6=A1=A3https://g1879.gitee.io/drissionpagedocs/ChromiumPage/n?= =?UTF-8?q?etwork=5Flistener/#listenwait=20=E6=AD=A4=E5=A4=84=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=90=8D=E7=A7=B0=E5=BA=94=E4=B8=BAfix=5Fcount?= =?UTF-8?q?=EF=BC=8C=E6=84=8F=E4=B8=BA=E8=BF=94=E5=9B=9E=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E5=9B=BA=E5=AE=9A=EF=BC=88fix=EF=BC=89=EF=BC=8Cfit=5F?= =?UTF-8?q?count=E5=88=99=E6=B2=A1=E6=9C=89=E6=98=8E=E7=A1=AE=E7=9A=84?= =?UTF-8?q?=E8=8B=B1=E6=96=87=E5=90=AB=E4=B9=89=EF=BC=8C=E6=AD=A4=E5=A4=84?= =?UTF-8?q?=E5=BA=94=E4=B8=BAtypo=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marquez <10957881+m4rque2@user.noreply.gitee.com> --- DrissionPage/_units/listener.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DrissionPage/_units/listener.py b/DrissionPage/_units/listener.py index 9063b53..49ba825 100644 --- a/DrissionPage/_units/listener.py +++ b/DrissionPage/_units/listener.py @@ -112,13 +112,13 @@ class Listener(object): self._set_callback() self.listening = True - def wait(self, count=1, timeout=None, fit_count=True, raise_err=None): + def wait(self, count=1, timeout=None, fix_count=True, raise_err=None): """等待符合要求的数据包到达指定数量 :param count: 需要捕捉的数据包数量 :param timeout: 超时时间,为None无限等待 - :param fit_count: 是否必须满足总数要求,发生超时,为True返回False,为False返回已捕捉到的数据包 + :param fix_count: 是否必须满足总数要求,发生超时,为True返回False,为False返回已捕捉到的数据包 :param raise_err: 超时时是否抛出错误,为None时根据Settings设置 - :return: count为1时返回数据包对象,大于1时返回列表,超时且fit_count为True时返回False + :return: count为1时返回数据包对象,大于1时返回列表,超时且fix_count为True时返回False """ if not self.listening: raise RuntimeError('监听未启动或已暂停。') @@ -138,7 +138,7 @@ class Listener(object): break if fail: - if fit_count or not self._caught.qsize(): + if fix_count or not self._caught.qsize(): if raise_err is True or Settings.raise_when_wait_failed is True: raise WaitTimeoutError(f'等待数据包失败(等待{timeout}秒)。') else: