add button to GUI
This commit is contained in:
@@ -4,6 +4,7 @@ from concurrent.futures import ThreadPoolExecutor
|
||||
|
||||
import params
|
||||
from logs.AppLogging import init_logger
|
||||
from pojo.ModeEnum import ModeEnum
|
||||
from utils.excel_reader import ExcelHelper
|
||||
from workers.commandor_page import CommandorPage
|
||||
|
||||
@@ -13,7 +14,8 @@ logger = logging.getLogger()
|
||||
logger.addHandler(logging.StreamHandler(stream=sys.stdout))
|
||||
|
||||
|
||||
def start_book(start_number, end_number, store_choose_state=0, max_workers=10, proxy_type=0):
|
||||
def start_book(start_number, end_number, store_choose_state=0, max_workers=10, proxy_type=0,
|
||||
mode: ModeEnum = ModeEnum.MANUAL):
|
||||
# read the contact, and contact the 2 objects together
|
||||
excel_reader = ExcelHelper()
|
||||
all_contacts = excel_reader.read_contacts()
|
||||
@@ -25,8 +27,9 @@ def start_book(start_number, end_number, store_choose_state=0, max_workers=10, p
|
||||
for contact in contacts:
|
||||
proxy = get_proxy(contact.phone, proxy_type)
|
||||
# start the task in thread
|
||||
executor.submit(CommandorPage(contact, store_type=store_choose_state, proxy_type=proxy_type).start_page,
|
||||
proxy)
|
||||
executor.submit(
|
||||
CommandorPage(contact, store_type=store_choose_state, proxy_type=proxy_type, mode=mode).start_page,
|
||||
proxy)
|
||||
|
||||
|
||||
def get_proxy(phone_number, proxy_type=0):
|
||||
|
||||
Reference in New Issue
Block a user