qrpa 1.0.98__tar.gz → 1.0.100__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.

Files changed (37) hide show
  1. {qrpa-1.0.98 → qrpa-1.0.100}/PKG-INFO +1 -1
  2. {qrpa-1.0.98 → qrpa-1.0.100}/pyproject.toml +1 -1
  3. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/shein_ziniao.py +26 -25
  4. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa.egg-info/PKG-INFO +1 -1
  5. {qrpa-1.0.98 → qrpa-1.0.100}/README.md +0 -0
  6. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/RateLimitedSender.py +0 -0
  7. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/__init__.py +0 -0
  8. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/db_migrator.py +0 -0
  9. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/feishu_bot_app.py +0 -0
  10. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/feishu_client.py +0 -0
  11. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/feishu_logic.py +0 -0
  12. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/fun_base.py +0 -0
  13. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/fun_excel.py +0 -0
  14. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/fun_file.py +0 -0
  15. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/fun_web.py +0 -0
  16. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/fun_win.py +0 -0
  17. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/mysql_module/__init__.py +0 -0
  18. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/mysql_module/shein_product_model.py +0 -0
  19. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/mysql_module/shein_return_order_model.py +0 -0
  20. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/shein_daily_report_model.py +0 -0
  21. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/shein_excel.py +0 -0
  22. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/shein_lib.py +0 -0
  23. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/shein_mysql.py +0 -0
  24. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/shein_sqlite.py +0 -0
  25. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/temu_chrome.py +0 -0
  26. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/temu_excel.py +0 -0
  27. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/temu_lib.py +0 -0
  28. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/time_utils.py +0 -0
  29. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/time_utils_example.py +0 -0
  30. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa/wxwork.py +0 -0
  31. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa.egg-info/SOURCES.txt +0 -0
  32. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa.egg-info/dependency_links.txt +0 -0
  33. {qrpa-1.0.98 → qrpa-1.0.100}/qrpa.egg-info/top_level.txt +0 -0
  34. {qrpa-1.0.98 → qrpa-1.0.100}/setup.cfg +0 -0
  35. {qrpa-1.0.98 → qrpa-1.0.100}/setup.py +0 -0
  36. {qrpa-1.0.98 → qrpa-1.0.100}/tests/test_db_migrator.py +0 -0
  37. {qrpa-1.0.98 → qrpa-1.0.100}/tests/test_wxwork.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qrpa
3
- Version: 1.0.98
3
+ Version: 1.0.100
4
4
  Summary: qsir's rpa library
5
5
  Author: QSir
6
6
  Author-email: QSir <1171725650@qq.com>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "qrpa"
7
- version = "1.0.98"
7
+ version = "1.0.100"
8
8
  description = "qsir's rpa library"
9
9
  authors = [{ name = "QSir", email = "1171725650@qq.com" }]
10
10
  readme = "README.md"
@@ -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
- isprivacy: int = 0, isHeadless: int = 0,
157
- cookieTypeSave: int = 0, jsInfo: str = "") -> Dict[str, Any]:
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
- run_func: Callable, task_key: str,
344
- just_store_username: Optional[List[str]] = None,
345
- is_skip_store: Optional[Callable] = None
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, True)
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
- run_func: Callable, task_key: str,
428
- just_store_username: Optional[List[str]] = None,
429
- is_skip_store: Optional[Callable] = None
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
- max_threads: int = 3, run_func: Callable = None,
437
- task_key: str = None,
438
- just_store_username: Optional[List[str]] = None,
439
- is_skip_store: Optional[Callable] = None
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
- run: Optional[Callable] = None,
464
- run_summary: Optional[Callable] = None,
465
- run_notify: Optional[Callable] = None,
466
- task_key: Optional[str] = None,
467
- just_store_username: Optional[List[str]] = None,
468
- is_skip_store: Optional[Callable] = None,
469
- platform_name: Optional[str] = "SHEIN-全球",
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()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qrpa
3
- Version: 1.0.98
3
+ Version: 1.0.100
4
4
  Summary: qsir's rpa library
5
5
  Author: QSir
6
6
  Author-email: QSir <1171725650@qq.com>
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