qrpa 1.0.98__tar.gz → 1.0.99__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of qrpa might be problematic. Click here for more details.
- {qrpa-1.0.98 → qrpa-1.0.99}/PKG-INFO +1 -1
- {qrpa-1.0.98 → qrpa-1.0.99}/pyproject.toml +1 -1
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/shein_ziniao.py +26 -25
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa.egg-info/PKG-INFO +1 -1
- {qrpa-1.0.98 → qrpa-1.0.99}/README.md +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/RateLimitedSender.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/__init__.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/db_migrator.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/feishu_bot_app.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/feishu_client.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/feishu_logic.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/fun_base.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/fun_excel.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/fun_file.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/fun_web.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/fun_win.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/mysql_module/__init__.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/mysql_module/shein_product_model.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/mysql_module/shein_return_order_model.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/shein_daily_report_model.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/shein_excel.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/shein_lib.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/shein_mysql.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/shein_sqlite.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/temu_chrome.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/temu_excel.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/temu_lib.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/time_utils.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/time_utils_example.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa/wxwork.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa.egg-info/SOURCES.txt +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa.egg-info/dependency_links.txt +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/qrpa.egg-info/top_level.txt +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/setup.cfg +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/setup.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/tests/test_db_migrator.py +0 -0
- {qrpa-1.0.98 → qrpa-1.0.99}/tests/test_wxwork.py +0 -0
|
@@ -153,8 +153,8 @@ class ZiniaoBrowser:
|
|
|
153
153
|
self.config = config
|
|
154
154
|
|
|
155
155
|
def open_store(self, store_info: str, isWebDriverReadOnlyMode: int = 0,
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
isprivacy: int = 0, isHeadless: int = 0,
|
|
157
|
+
cookieTypeSave: int = 0, jsInfo: str = "") -> Dict[str, Any]:
|
|
158
158
|
"""打开店铺"""
|
|
159
159
|
request_id = str(uuid.uuid4())
|
|
160
160
|
data = {
|
|
@@ -272,7 +272,7 @@ class ZiniaoTaskManager:
|
|
|
272
272
|
self.browser = browser
|
|
273
273
|
self.config = config
|
|
274
274
|
|
|
275
|
-
def daily_cleanup_superbrowser(self, browser_id):
|
|
275
|
+
def daily_cleanup_superbrowser(self, browser_id, force=False):
|
|
276
276
|
"""
|
|
277
277
|
每天删除一次SuperBrowser缓存文件夹
|
|
278
278
|
|
|
@@ -318,7 +318,7 @@ class ZiniaoTaskManager:
|
|
|
318
318
|
log(f"读取标志文件时出错: {e}")
|
|
319
319
|
# 如果读取出错,继续执行清理
|
|
320
320
|
|
|
321
|
-
if need_cleanup:
|
|
321
|
+
if need_cleanup or force:
|
|
322
322
|
try:
|
|
323
323
|
# 删除目标文件夹
|
|
324
324
|
log(f"正在删除文件夹: {target_folder}")
|
|
@@ -340,10 +340,10 @@ class ZiniaoTaskManager:
|
|
|
340
340
|
return True
|
|
341
341
|
|
|
342
342
|
def run_single_store_task(self, browser_info: Dict[str, Any],
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
343
|
+
run_func: Callable, task_key: str,
|
|
344
|
+
just_store_username: Optional[List[str]] = None,
|
|
345
|
+
is_skip_store: Optional[Callable] = None
|
|
346
|
+
):
|
|
347
347
|
"""运行单个店铺的任务"""
|
|
348
348
|
store_id = browser_info.get('browserOauth')
|
|
349
349
|
store_name = browser_info.get("browserName")
|
|
@@ -420,24 +420,25 @@ class ZiniaoTaskManager:
|
|
|
420
420
|
break
|
|
421
421
|
except:
|
|
422
422
|
send_exception(f'第{retry_count}次运行失败,准备重新打开店铺: {store_username},{store_name},{store_id}')
|
|
423
|
+
self.daily_cleanup_superbrowser(browser_id)
|
|
423
424
|
if retry_count > 5:
|
|
424
425
|
break
|
|
425
426
|
|
|
426
427
|
def run_all_stores_task(self, browser_list: List[Dict[str, Any]],
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
428
|
+
run_func: Callable, task_key: str,
|
|
429
|
+
just_store_username: Optional[List[str]] = None,
|
|
430
|
+
is_skip_store: Optional[Callable] = None
|
|
431
|
+
):
|
|
431
432
|
"""循环运行所有店铺的任务"""
|
|
432
433
|
for browser_info in browser_list:
|
|
433
434
|
self.run_single_store_task(browser_info, run_func, task_key, just_store_username, is_skip_store)
|
|
434
435
|
|
|
435
436
|
def run_with_thread_pool(self, browser_list: List[Dict[str, Any]],
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
437
|
+
max_threads: int = 3, run_func: Callable = None,
|
|
438
|
+
task_key: str = None,
|
|
439
|
+
just_store_username: Optional[List[str]] = None,
|
|
440
|
+
is_skip_store: Optional[Callable] = None
|
|
441
|
+
):
|
|
441
442
|
"""使用线程池控制最大并发线程数运行任务"""
|
|
442
443
|
with ThreadPoolExecutor(max_workers=max_threads) as executor:
|
|
443
444
|
task = partial(self.run_single_store_task,
|
|
@@ -460,14 +461,14 @@ class ZiniaoRunner:
|
|
|
460
461
|
self.task_manager = ZiniaoTaskManager(self.browser, config)
|
|
461
462
|
|
|
462
463
|
def execute(self, run_prepare: Optional[Callable] = None,
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
464
|
+
run: Optional[Callable] = None,
|
|
465
|
+
run_summary: Optional[Callable] = None,
|
|
466
|
+
run_notify: Optional[Callable] = None,
|
|
467
|
+
task_key: Optional[str] = None,
|
|
468
|
+
just_store_username: Optional[List[str]] = None,
|
|
469
|
+
is_skip_store: Optional[Callable] = None,
|
|
470
|
+
platform_name: Optional[str] = "SHEIN-全球",
|
|
471
|
+
):
|
|
471
472
|
"""主执行入口"""
|
|
472
473
|
# 前置执行 if run_prepare:
|
|
473
474
|
run_prepare()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|