use only one card pool
This commit is contained in:
+7
-7
@@ -18,26 +18,26 @@ class Commandor:
|
||||
self.clear_app_data()
|
||||
|
||||
subprocess.call(
|
||||
"adb shell am start -n {}/.{} --es \"first_name\" \"{}\" --es \"last_name\" \"{}\" --es \"phone\" \"{}\" --es \"email\" \"{}\" --es \"passport\" \"{}\"".format(
|
||||
"/Users/panlei/Library/Android/sdk/platform-tools/adb shell am start -n {}/.{} --es \"first_name\" \"{}\" --es \"last_name\" \"{}\" --es \"phone\" \"{}\" --es \"email\" \"{}\" --es \"passport\" \"{}\"".format(
|
||||
PACKAGE_NAME, ACTIVITY_NAME, contact.first_name, contact.last_name, contact.phone, "{}_{}@gmail.com".format(contact.first_name,contact.last_name), contact.passport), shell=True)
|
||||
pass
|
||||
|
||||
def clear_app_data(self):
|
||||
subprocess.call("adb shell pm clear {}".format(PACKAGE_NAME), shell=True)
|
||||
subprocess.call("/Users/panlei/Library/Android/sdk/platform-tools/adb shell pm clear {}".format(PACKAGE_NAME), shell=True)
|
||||
|
||||
def send_otp(self, otp: str):
|
||||
subprocess.call(
|
||||
"adb shell am broadcast -a {} --es otp \"{}\"".format(BROADCAST_ACTION, otp), shell=True)
|
||||
"/Users/panlei/Library/Android/sdk/platform-tools/adb shell am broadcast -a {} --es otp \"{}\"".format(BROADCAST_ACTION, otp), shell=True)
|
||||
pass
|
||||
|
||||
def reset_air_plan_mode(self):
|
||||
subprocess.call("adb shell settings put global airplane_mode_on 1", shell=True)
|
||||
subprocess.call("/Users/panlei/Library/Android/sdk/platform-tools/adb shell settings put global airplane_mode_on 1", shell=True)
|
||||
time.sleep(1)
|
||||
subprocess.call("adb shell am broadcast -a android.intent.action.AIRPLANE_MODE", shell=True)
|
||||
subprocess.call("/Users/panlei/Library/Android/sdk/platform-tools/adb shell am broadcast -a android.intent.action.AIRPLANE_MODE", shell=True)
|
||||
time.sleep(1)
|
||||
subprocess.call("adb shell settings put global airplane_mode_on 0", shell=True)
|
||||
subprocess.call("/Users/panlei/Library/Android/sdk/platform-tools/adb shell settings put global airplane_mode_on 0", shell=True)
|
||||
time.sleep(1)
|
||||
subprocess.call("adb shell am broadcast -a android.intent.action.AIRPLANE_MODE", shell=True)
|
||||
subprocess.call("/Users/panlei/Library/Android/sdk/platform-tools/adb shell am broadcast -a android.intent.action.AIRPLANE_MODE", shell=True)
|
||||
time.sleep(10)
|
||||
|
||||
|
||||
|
||||
+5
-5
@@ -25,11 +25,11 @@ class DataManager:
|
||||
cred = credentials.Certificate(definitions.ROOT_DIR + "/appointment.json")
|
||||
self._app = firebase_admin.initialize_app(cred)
|
||||
self._db = firestore.client()
|
||||
# contact_collection = self._db.collection(CONTACT_COLLECTION_NAME)
|
||||
# self._contact_list = []
|
||||
# for contact in contact_collection.stream():
|
||||
# contact_pojo = ContactPojo.from_firestore_dict(contact.to_dict())
|
||||
# self._contact_list.append(contact_pojo)
|
||||
contact_collection = self._db.collection(CONTACT_COLLECTION_NAME)
|
||||
self._contact_list = []
|
||||
for contact in contact_collection.stream():
|
||||
contact_pojo = ContactPojo.from_firestore_dict(contact.to_dict())
|
||||
self._contact_list.append(contact_pojo)
|
||||
|
||||
def get_all_error_items(self):
|
||||
pass
|
||||
|
||||
@@ -166,8 +166,8 @@ def read_all_the_phone_number():
|
||||
|
||||
|
||||
def start_book():
|
||||
slot_number = 3
|
||||
slot_sum = 12
|
||||
slot_number = 1
|
||||
slot_sum = 22
|
||||
for i in range(slot_number, slot_sum + 1):
|
||||
card_pool.reset()
|
||||
logger.info("will switch to " + str(i))
|
||||
@@ -213,5 +213,5 @@ if __name__ == '__main__':
|
||||
logger.addHandler(logging.StreamHandler(stream=sys.stdout))
|
||||
start_listen()
|
||||
start_book()
|
||||
# card_pool.switch_to_slot(31)
|
||||
# card_pool.switch_to_slot(12)
|
||||
|
||||
|
||||
@@ -10,15 +10,16 @@ MODEM_POOL_PORTS = [
|
||||
"/dev/tty.usbmodem1431201",
|
||||
"/dev/tty.usbmodem1431203",
|
||||
"/dev/tty.usbmodem1431205",
|
||||
"/dev/tty.usbmodem1431207",
|
||||
"/dev/tty.usbmodem1431301",
|
||||
"/dev/tty.usbmodem1431207"
|
||||
# ,
|
||||
# "/dev/tty.usbmodem1431301",
|
||||
## "/dev/tty.usbmodem1431303",
|
||||
"/dev/tty.usbmodem1431305",
|
||||
"/dev/tty.usbmodem1431307",
|
||||
"/dev/tty.usbmodem1431401",
|
||||
"/dev/tty.usbmodem1431403",
|
||||
"/dev/tty.usbmodem1431405",
|
||||
"/dev/tty.usbmodem1431407"
|
||||
# "/dev/tty.usbmodem1431305",
|
||||
# "/dev/tty.usbmodem1431307",
|
||||
# "/dev/tty.usbmodem1431401",
|
||||
# "/dev/tty.usbmodem1431403",
|
||||
# "/dev/tty.usbmodem1431405",
|
||||
# "/dev/tty.usbmodem1431407"
|
||||
]
|
||||
CARD_POOL_PORT = "/dev/tty.usbmodem1432101"
|
||||
|
||||
|
||||
@@ -16,7 +16,9 @@ class SerialModem():
|
||||
|
||||
def get_ccid(self):
|
||||
cmd = "AT+CCID\r"
|
||||
self.modem.connect()
|
||||
self.modem.connect("0000")
|
||||
print("try to get ccid")
|
||||
response = self.modem.write(cmd, True)
|
||||
self.ccid = response[0].split(" ")[1].replace("\"", "")
|
||||
print("The SIM card ccid is:" + self.ccid)
|
||||
print("The SIM phone number is:" + str(self.modem.ownNumber))
|
||||
|
||||
@@ -10,7 +10,7 @@ from main import card_pool, get_devices_ports
|
||||
def read_all_the_phone_number():
|
||||
params.oracle_log_sender.send_log(msg="SIM卡自检开始", subject=LOG_SUBJECT_EVENT, type=TYPE_EVENT_RESET_ALL_SIM_CARDS)
|
||||
slot_number = 1
|
||||
slot_sum = 12
|
||||
slot_sum = 22
|
||||
# card_pool.switch_to_slot(29)
|
||||
params.firebase_store_manager.clear_all_sim_info()
|
||||
for i in range(slot_number, slot_sum + 1):
|
||||
|
||||
Reference in New Issue
Block a user