use constants in params.py

This commit is contained in:
2022-03-15 15:29:27 +01:00
parent d20ebedd62
commit 0ba0190ce1
3 changed files with 3 additions and 3 deletions
+2 -3
View File
@@ -4,6 +4,7 @@ import time
import serial import serial
from serial import Serial from serial import Serial
from definitions import BAUDRATE
from error.SIMError import SIMError from error.SIMError import SIMError
from logs.LogSender import LOG_APPOINTMENT_SUCCESS, SUBJECT_SIM_INFO from logs.LogSender import LOG_APPOINTMENT_SUCCESS, SUBJECT_SIM_INFO
from params import firebase_store_manager, oracle_log_sender from params import firebase_store_manager, oracle_log_sender
@@ -12,7 +13,6 @@ from utils.excel_reader import ExcelHelper
class ModemPool: class ModemPool:
BAUDRATE = 115200
phone_number_position = 10 phone_number_position = 10
TAG = "ModemPool" TAG = "ModemPool"
@@ -24,7 +24,7 @@ class ModemPool:
self._db_manager = firebase_store_manager self._db_manager = firebase_store_manager
for port in self._port_list: for port in self._port_list:
ser = serial.Serial(port, self.BAUDRATE, timeout=1) ser = serial.Serial(port, BAUDRATE, timeout=1)
self._serial_list.append(ser) self._serial_list.append(ser)
def reset_all_modems(self): def reset_all_modems(self):
@@ -101,7 +101,6 @@ class ModemPool:
msg = ser.read(100) msg = ser.read(100)
except Exception as exc: except Exception as exc:
print(exc) print(exc)
# msg = ser.read(100)
print(msg) print(msg)
return msg return msg
+1
View File
@@ -192,6 +192,7 @@ def start_book():
modem.phone_number = contact[0].phone modem.phone_number = contact[0].phone
modem.contact = contact[0] modem.contact = contact[0]
if modem.contact: if modem.contact:
commandor.start_page(modem.contact) commandor.start_page(modem.contact)
start_to_handle_sms(modem) start_to_handle_sms(modem)
except Exception as error: except Exception as error:
Binary file not shown.