need to remove duplicated emails
This commit is contained in:
@@ -20,7 +20,7 @@ from pojo.serial_modem import SerialModem
|
||||
from utils.excel_reader import ExcelHelper
|
||||
from utils.message_receiver import MessageReceiver
|
||||
|
||||
OTP_TIMEOUT = 120
|
||||
OTP_TIMEOUT = 180
|
||||
is_finished = False
|
||||
commandor = CommandorPage()
|
||||
thread_event = None
|
||||
@@ -69,7 +69,7 @@ def timeout_occurred(serial_modem: SerialModem):
|
||||
def start_to_handle_sms(serial_modem: SerialModem):
|
||||
global current_gsm_modem
|
||||
current_gsm_modem = serial_modem.modem
|
||||
current_gsm_modem.deleteMultipleStoredSms(memory="SM")
|
||||
# current_gsm_modem.deleteMultipleStoredSms(memory="SM")
|
||||
serial_modem.modem.smsReceivedCallback = handle_sms
|
||||
global is_finished
|
||||
is_finished = False
|
||||
@@ -164,14 +164,13 @@ def on_ready_for_otp(e: Event, commandor: CommandorPage):
|
||||
def start_book():
|
||||
slot_number = 1
|
||||
slot_sum = 2
|
||||
for i in reversed(range(slot_number, slot_sum + 1)):
|
||||
for i in range(slot_number, slot_sum + 1):
|
||||
card_pool.reset()
|
||||
logger.info("will switch to " + str(i))
|
||||
card_pool.switch_to_slot(i)
|
||||
modem_pool = ModemPool(get_devices_ports())
|
||||
modem_pool.reset_all_modems()
|
||||
modem_list = init_modems()
|
||||
# create listeners for chaque modem
|
||||
# read the contact, and contact the 2 objects together
|
||||
excel_reader = ExcelHelper()
|
||||
contacts = excel_reader.read_contacts()
|
||||
@@ -183,7 +182,7 @@ def start_book():
|
||||
# get contact for current modem
|
||||
modem.get_ccid()
|
||||
# find the contact with ccid
|
||||
contact = [contact for contact in contacts if contact.ccid == modem.ccid]
|
||||
contact = [contact for contact in contacts if contact.ccid.replace("F", "") == modem.ccid]
|
||||
if len(contact) > 0:
|
||||
modem.phone_number = contact[0].phone
|
||||
modem.contact = contact[0]
|
||||
@@ -215,5 +214,5 @@ if __name__ == '__main__':
|
||||
logger = logging.getLogger()
|
||||
logger.addHandler(logging.StreamHandler(stream=sys.stdout))
|
||||
start_listen()
|
||||
start_book()
|
||||
# start_book()
|
||||
# card_pool.switch_to_slot(12)
|
||||
|
||||
Reference in New Issue
Block a user