qrpa 1.0.51__py3-none-any.whl → 1.0.53__py3-none-any.whl
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/fun_base.py +6 -9
- qrpa/mysql_module/shein_return_order_model.py +3 -0
- qrpa/shein_lib.py +7 -23
- qrpa/shein_ziniao.py +9 -3
- {qrpa-1.0.51.dist-info → qrpa-1.0.53.dist-info}/METADATA +1 -1
- {qrpa-1.0.51.dist-info → qrpa-1.0.53.dist-info}/RECORD +8 -8
- {qrpa-1.0.51.dist-info → qrpa-1.0.53.dist-info}/WHEEL +0 -0
- {qrpa-1.0.51.dist-info → qrpa-1.0.53.dist-info}/top_level.txt +0 -0
qrpa/fun_base.py
CHANGED
|
@@ -13,6 +13,11 @@ from .RateLimitedSender import RateLimitedSender
|
|
|
13
13
|
|
|
14
14
|
from typing import TypedDict
|
|
15
15
|
|
|
16
|
+
# 自定义错误类型,继承自 Exception
|
|
17
|
+
class NetWorkIdleTimeout(Exception):
|
|
18
|
+
"""这是一个自定义错误类型"""
|
|
19
|
+
pass
|
|
20
|
+
|
|
16
21
|
# 定义一个 TypedDict 来提供配置结构的类型提示
|
|
17
22
|
|
|
18
23
|
class ZiNiao(TypedDict):
|
|
@@ -161,7 +166,6 @@ def remove_columns(matrix, indices):
|
|
|
161
166
|
# 遍历每行,只保留不在indices中的列
|
|
162
167
|
return [[row[i] for i in indices_to_keep] for row in matrix]
|
|
163
168
|
|
|
164
|
-
|
|
165
169
|
def filter_columns(matrix, indices):
|
|
166
170
|
"""
|
|
167
171
|
过滤二维列表,只保留指定索引的列
|
|
@@ -182,7 +186,6 @@ def filter_columns(matrix, indices):
|
|
|
182
186
|
# 将过滤后的列转回二维列表
|
|
183
187
|
return [list(row) for row in zip(*filtered_columns)]
|
|
184
188
|
|
|
185
|
-
|
|
186
189
|
# # 示例使用
|
|
187
190
|
# matrix = [
|
|
188
191
|
# [1, 2, 3, 4],
|
|
@@ -216,7 +219,6 @@ def add_column_to_2d_list(data, new_col, index=None):
|
|
|
216
219
|
new_data.append(row)
|
|
217
220
|
return new_data
|
|
218
221
|
|
|
219
|
-
|
|
220
222
|
def add_prefixed_column(data, header, value):
|
|
221
223
|
"""
|
|
222
224
|
给二维列表增加第一列,第一行为 header,后面为 value。
|
|
@@ -232,7 +234,6 @@ def add_prefixed_column(data, header, value):
|
|
|
232
234
|
new_col = [header] + [value] * (len(data) - 1)
|
|
233
235
|
return [[new_col[i]] + row for i, row in enumerate(data)]
|
|
234
236
|
|
|
235
|
-
|
|
236
237
|
def add_suffixed_column(data, header, value):
|
|
237
238
|
"""
|
|
238
239
|
给二维列表增加第一列,第一行为 header,后面为 value。
|
|
@@ -248,7 +249,6 @@ def add_suffixed_column(data, header, value):
|
|
|
248
249
|
new_col = [header] + [value] * (len(data) - 1)
|
|
249
250
|
return [row + [new_col[i]] for i, row in enumerate(data)]
|
|
250
251
|
|
|
251
|
-
|
|
252
252
|
def merge_2d_lists_keep_first_header(data1, data2):
|
|
253
253
|
"""
|
|
254
254
|
合并两个二维列表,只保留第一个列表的标题(即第一行)。
|
|
@@ -268,7 +268,6 @@ def merge_2d_lists_keep_first_header(data1, data2):
|
|
|
268
268
|
|
|
269
269
|
return [header] + rows1 + rows2
|
|
270
270
|
|
|
271
|
-
|
|
272
271
|
def insert_total_row(data, row_index=1, label="合计"):
|
|
273
272
|
"""
|
|
274
273
|
在指定行插入一行,第一列为 label,其余为空字符串。
|
|
@@ -286,7 +285,6 @@ def insert_total_row(data, row_index=1, label="合计"):
|
|
|
286
285
|
|
|
287
286
|
return data[:row_index] + [new_row] + data[row_index:]
|
|
288
287
|
|
|
289
|
-
|
|
290
288
|
def insert_empty_column_after(data, col_index, new_header="单价成本"):
|
|
291
289
|
"""
|
|
292
290
|
在二维列表中指定列的后面插入一个新列,标题为 new_header,其余内容为空字符串。
|
|
@@ -308,7 +306,6 @@ def insert_empty_column_after(data, col_index, new_header="单价成本"):
|
|
|
308
306
|
|
|
309
307
|
return new_data
|
|
310
308
|
|
|
311
|
-
|
|
312
309
|
def insert_empty_column_after_column_name(data, target_col_name, new_header="单价成本"):
|
|
313
310
|
"""
|
|
314
311
|
在指定列名对应的列后面插入一个新列,标题为 new_header,其余行为空字符串。
|
|
@@ -334,4 +331,4 @@ def insert_empty_column_after_column_name(data, target_col_name, new_header="单
|
|
|
334
331
|
row.insert(col_index + 1, insert_value)
|
|
335
332
|
new_data.append(row)
|
|
336
333
|
|
|
337
|
-
return new_data
|
|
334
|
+
return new_data
|
|
@@ -77,6 +77,7 @@ class SheinReturnOrder(Base):
|
|
|
77
77
|
return_reason_type = Column(Integer, nullable=True, comment='退货原因类型')
|
|
78
78
|
return_reason_type_name = Column(String(100), nullable=True, comment='退货原因类型名称')
|
|
79
79
|
return_reason = Column(Text, nullable=True, comment='退货原因')
|
|
80
|
+
reject_pic_url_list = Column(JSON, nullable=True, comment='拒绝图片URL列表')
|
|
80
81
|
|
|
81
82
|
# 商品信息
|
|
82
83
|
skc_name_list = Column(JSON, nullable=True, comment='SKC名称列表')
|
|
@@ -310,6 +311,7 @@ class SheinReturnOrderManager:
|
|
|
310
311
|
return_reason_type=data.get('returnReasonType'),
|
|
311
312
|
return_reason_type_name=data.get('returnReasonTypeName'),
|
|
312
313
|
return_reason=data.get('returnReason'),
|
|
314
|
+
reject_pic_url_list=data.get('rejectPicUrlList'),
|
|
313
315
|
skc_name_list=data.get('skcNameList'),
|
|
314
316
|
supplier_code_list=data.get('supplierCodeList'),
|
|
315
317
|
goods_thumb=data.get('goodsThumb'),
|
|
@@ -379,6 +381,7 @@ class SheinReturnOrderManager:
|
|
|
379
381
|
existing_order.return_reason_type = data.get('returnReasonType')
|
|
380
382
|
existing_order.return_reason_type_name = data.get('returnReasonTypeName')
|
|
381
383
|
existing_order.return_reason = data.get('returnReason')
|
|
384
|
+
existing_order.reject_pic_url_list = data.get('rejectPicUrlList'),
|
|
382
385
|
existing_order.skc_name_list = data.get('skcNameList')
|
|
383
386
|
existing_order.supplier_code_list = data.get('supplierCodeList')
|
|
384
387
|
existing_order.goods_thumb = data.get('goodsThumb')
|
qrpa/shein_lib.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from .fun_file import read_dict_from_file, write_dict_to_file, read_dict_from_file_ex, write_dict_to_file_ex
|
|
2
|
-
from .fun_base import log, send_exception, md5_string, get_safe_value
|
|
2
|
+
from .fun_base import log, send_exception, md5_string, get_safe_value, NetWorkIdleTimeout
|
|
3
3
|
from .fun_web import fetch, full_screen_shot
|
|
4
4
|
from .time_utils import TimeUtils
|
|
5
5
|
from .wxwork import WxWorkBot
|
|
@@ -80,29 +80,13 @@ class SheinLib:
|
|
|
80
80
|
web_page.wait_for_load_state("load")
|
|
81
81
|
web_page.wait_for_timeout(1000)
|
|
82
82
|
|
|
83
|
-
if '
|
|
84
|
-
log('SHEIN全球商家中心 中断循环', self.store_username, self.store_name)
|
|
85
|
-
web_page.wait_for_load_state("load")
|
|
86
|
-
web_page.wait_for_timeout(1000)
|
|
87
|
-
web_page.wait_for_load_state("networkidle")
|
|
88
|
-
web_page.wait_for_timeout(1000)
|
|
89
|
-
break
|
|
90
|
-
|
|
91
|
-
if '后台首页' in web_page.title() and 'https://sso.geiwohuo.com/#/home' in web_page.url:
|
|
92
|
-
log('后台首页 中断循环', self.store_username, self.store_name)
|
|
93
|
-
web_page.wait_for_load_state("load")
|
|
94
|
-
web_page.wait_for_timeout(1000)
|
|
95
|
-
web_page.wait_for_load_state("networkidle")
|
|
96
|
-
web_page.wait_for_timeout(1000)
|
|
97
|
-
break
|
|
83
|
+
if 'https://sso.geiwohuo.com/#/home' in web_page.url:
|
|
98
84
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
web_page.wait_for_timeout(1000)
|
|
105
|
-
break
|
|
85
|
+
if 'SHEIN全球商家中心' in web_page.title() or '后台首页' in web_page.title() or '商家后台' in web_page.title():
|
|
86
|
+
log(web_page.title(), '中断循环', self.store_username, self.store_name)
|
|
87
|
+
web_page.wait_for_load_state("load")
|
|
88
|
+
web_page.wait_for_timeout(2000)
|
|
89
|
+
break
|
|
106
90
|
|
|
107
91
|
if 'mrs.biz.sheincorp.cn' in web_page.url and '商家后台' in web_page.title():
|
|
108
92
|
web_page.goto('https://sso.geiwohuo.com/#/home')
|
qrpa/shein_ziniao.py
CHANGED
|
@@ -21,7 +21,7 @@ from playwright.sync_api import TimeoutError as PlaywrightTimeoutError
|
|
|
21
21
|
from functools import partial
|
|
22
22
|
|
|
23
23
|
from .fun_win import find_software_install_path
|
|
24
|
-
from .fun_base import log, hostname, send_exception
|
|
24
|
+
from .fun_base import log, hostname, send_exception, NetWorkIdleTimeout
|
|
25
25
|
from .fun_file import check_progress_json_ex, get_progress_json_ex, done_progress_json_ex, write_dict_to_file_ex
|
|
26
26
|
|
|
27
27
|
class ZiniaoClient:
|
|
@@ -260,7 +260,6 @@ class ZiniaoBrowser:
|
|
|
260
260
|
page.goto(launcher_page)
|
|
261
261
|
page.wait_for_load_state('load')
|
|
262
262
|
|
|
263
|
-
# 业务逻辑
|
|
264
263
|
run_func(page, store_username, store_name, task_key)
|
|
265
264
|
|
|
266
265
|
# 标记完成
|
|
@@ -332,7 +331,14 @@ class ZiniaoTaskManager:
|
|
|
332
331
|
ip_usable = self.browser.open_ip_check(browser_context, ip_check_url)
|
|
333
332
|
if ip_usable:
|
|
334
333
|
print("ip检测通过,打开店铺平台主页")
|
|
335
|
-
|
|
334
|
+
# 业务逻辑
|
|
335
|
+
try:
|
|
336
|
+
self.browser.open_launcher_page(browser_context, ret_json.get("launcherPage"), store_username, store_name, run_func, task_key)
|
|
337
|
+
except NetWorkIdleTimeout:
|
|
338
|
+
log('捕获到自定义错误: NetWorkIdleTimeout')
|
|
339
|
+
self.browser.close_store(store_id)
|
|
340
|
+
pass
|
|
341
|
+
|
|
336
342
|
else:
|
|
337
343
|
print("ip检测不通过,请检查")
|
|
338
344
|
except:
|
|
@@ -4,17 +4,17 @@ qrpa/db_migrator.py,sha256=2VmhzcMsU0MKpl-mNCwKyV8tLTqyEysSpP27-S_rQZ8,21862
|
|
|
4
4
|
qrpa/feishu_bot_app.py,sha256=6r2YqCAMUN7y3F7onoABRmHC7S-UPOLHwbhsQnQ3IRc,9452
|
|
5
5
|
qrpa/feishu_client.py,sha256=gXvyhf7r-IqeDhPjM01SfsGf17t8g1ZwUAkhymBkBeg,17544
|
|
6
6
|
qrpa/feishu_logic.py,sha256=yuwb-LeZiHKGlz-W8JobinorHonVa8L-5h12WxnU7_Q,67508
|
|
7
|
-
qrpa/fun_base.py,sha256=
|
|
7
|
+
qrpa/fun_base.py,sha256=lMzqPwsbVfe968CUR2MVNImzIskIUZqPCE2tWxYqb5o,10728
|
|
8
8
|
qrpa/fun_excel.py,sha256=iDngd15qBX_HHZh_owftRa5ZArquTneY2JegRdNvk4U,115820
|
|
9
9
|
qrpa/fun_file.py,sha256=yzjDV16WL5vRys7J4uQcNzIFkX4D5MAlSCwxcD-mwQo,11966
|
|
10
10
|
qrpa/fun_web.py,sha256=F6cxwwOxB8twg2XK73oAvKla0FqpwDYJiM37CWmFwXo,6322
|
|
11
11
|
qrpa/fun_win.py,sha256=-LnTeocdTt72NVH6VgLdpAT9_C5oV9okeudXG6CftMA,8034
|
|
12
12
|
qrpa/shein_daily_report_model.py,sha256=H8oZmIN5Pyqe306W1_xuz87lOqLQ_LI5RjXbaxDkIzE,12589
|
|
13
13
|
qrpa/shein_excel.py,sha256=7dWDKP5JlD_2sb3Uv3JK_VJvppGwidsP3UAyPA89Ga8,115472
|
|
14
|
-
qrpa/shein_lib.py,sha256=
|
|
14
|
+
qrpa/shein_lib.py,sha256=0NYJ5UnbMbg0dg2Tffd0y7JVcpxxlTqCuFuK_VfskE8,108774
|
|
15
15
|
qrpa/shein_mysql.py,sha256=MGPJsz13evsLygZWhmitpPzUswiTKZ91VFvr8KA0M40,750
|
|
16
16
|
qrpa/shein_sqlite.py,sha256=ZQwD0Gz81q9WY7tY2HMEYvSF9r3N_G_Aur3bYfST9WY,5707
|
|
17
|
-
qrpa/shein_ziniao.py,sha256=
|
|
17
|
+
qrpa/shein_ziniao.py,sha256=kAOirjawPf-VxBxHFNpdDHCN2zL-O1U-2xybpmt34Xs,18692
|
|
18
18
|
qrpa/temu_chrome.py,sha256=CbtFy1QPan9xJdJcNZj-EsVGhUvv3ZTEPVDEA4-im40,2803
|
|
19
19
|
qrpa/temu_excel.py,sha256=ssAQvhtRGaTOLAVM3gS-AnmHPkIiHCT6gTsK1hoi-_8,6990
|
|
20
20
|
qrpa/temu_lib.py,sha256=hYB59zsLS3m3NTic_duTwPMOTSxlHyQVa8OhHnHm-1g,7199
|
|
@@ -22,8 +22,8 @@ qrpa/time_utils.py,sha256=ef0hhbN_6b-gcnz5ETIVOoxemIMvcxGVGGIRnHnGaBo,29564
|
|
|
22
22
|
qrpa/time_utils_example.py,sha256=shHOXKKF3QSzb0SHsNc34M61wEkkLuM30U9X1THKNS8,8053
|
|
23
23
|
qrpa/wxwork.py,sha256=gIytG19DZ5g7Tsl0-W3EbjfSnpIqZw-ua24gcB78YEg,11264
|
|
24
24
|
qrpa/mysql_module/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
|
-
qrpa/mysql_module/shein_return_order_model.py,sha256=
|
|
26
|
-
qrpa-1.0.
|
|
27
|
-
qrpa-1.0.
|
|
28
|
-
qrpa-1.0.
|
|
29
|
-
qrpa-1.0.
|
|
25
|
+
qrpa/mysql_module/shein_return_order_model.py,sha256=zvEQBVODpxQXWveUAF5z-be-DVI3WlF8UgvmwCTWP7o,26237
|
|
26
|
+
qrpa-1.0.53.dist-info/METADATA,sha256=YxiXzx5qK-76GGRhbt8AIi9lctAbYhzGfPKkSJyNF1g,231
|
|
27
|
+
qrpa-1.0.53.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
28
|
+
qrpa-1.0.53.dist-info/top_level.txt,sha256=F6T5igi0fhXDucPPUbmmSC0qFCDEsH5eVijfVF48OFU,5
|
|
29
|
+
qrpa-1.0.53.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|