add sleep before click on the valid btn

This commit is contained in:
2022-04-07 14:29:34 +02:00
parent 3647a2f811
commit 2582c7ba1e
3 changed files with 9 additions and 8 deletions
+4 -4
View File
@@ -1,5 +1,4 @@
import logging
import random
import sys
import time
from typing import Union
@@ -7,7 +6,6 @@ from typing import Union
from gsmmodem import GsmModem
import params
from commandor_page import CommandorPage
from logs.AppLogging import init_logger
from modems.ModemPool import ModemPool
from modems.card_pool import CardPool
@@ -16,7 +14,6 @@ from pojo.serial_modem import SerialModem
from utils.excel_reader import ExcelHelper
OTP_TIMEOUT = 40
commandor = CommandorPage()
thread_event = None
current_gsm_modem = None
card_pool = CardPool(CARD_POOL_PORT)
@@ -43,7 +40,6 @@ def create_modem_for_port(port: str) -> Union[SerialModem, None]:
def timeout_occurred(serial_modem: SerialModem):
logger.info("will close timeout modem")
serial_modem.modem.close()
commandor.reset_air_plan_mode()
def start_to_handle_sms(serial_modem: SerialModem):
@@ -57,6 +53,8 @@ def start_to_handle_sms(serial_modem: SerialModem):
serial_modem.modem.smsReceivedCallback = handle_sms
serial_modem.modem.smsTextMode = False
logger.info('Waiting for SMS message, for phone number ' + str(serial_modem.phone_number))
# input("Press Enter to continue...")
# return
listen_at = time.time()
while True:
time.sleep(2)
@@ -111,6 +109,8 @@ def start_waiting_sms():
modem.phone_number = contact[0].phone
modem.contact = contact[0]
start_to_handle_sms(modem)
# else:
# print("not found, skip")
except Exception as error:
print(error)
continue