ey-commerce-lib 1.0.15__py3-none-any.whl → 1.0.16__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 ey-commerce-lib might be problematic. Click here for more details.

@@ -1,5 +1,5 @@
1
1
  import asyncio
2
- import time
2
+ import traceback
3
3
 
4
4
  from httpx import AsyncClient, Timeout
5
5
  from playwright.async_api import async_playwright
@@ -705,9 +705,16 @@ class DxmClient:
705
705
  :return:
706
706
  """
707
707
  # 打开浏览器
708
+ # 打开浏览器
708
709
  try:
709
710
  async with async_playwright() as p:
710
- browser = await p.chromium.launch(headless=True)
711
+ browser = await p.chromium.launch(
712
+ headless=True,
713
+ args=[
714
+ '--start-maximized',
715
+ '--disable-blink-features=AutomationControlled',
716
+ ]
717
+ )
711
718
  context = await browser.new_context()
712
719
  # 设置cookie和headers
713
720
  await context.add_cookies([
@@ -722,6 +729,8 @@ class DxmClient:
722
729
  page = await context.new_page()
723
730
  # 访问
724
731
  await page.goto(f'{self.__base_url}/dxmCommodityProduct/openEditModal.htm?id={proid}&editOrCopy=0')
732
+ # 关闭模态框
733
+ await page.locator('#theNewestModalLabel > div.modal-dialog > div > div.modal-header > button').click()
725
734
  # 输入sku
726
735
  await page.locator('input.variationValue.ui-autocomplete-input').fill(front_sku)
727
736
  # 失去焦点
@@ -731,7 +740,7 @@ class DxmClient:
731
740
  # 点击保存
732
741
  await page.locator('.button.btn-orange.m-left10').first.click()
733
742
  except Exception as e:
734
- raise Exception(f'更新店小秘 仓库-商品详情中的平台sku失败-失败原因:{e}')
743
+ raise Exception(f'更新店小秘 仓库-商品详情中的平台sku失败-失败原因:{traceback.format_exc()}')
735
744
 
736
745
  async def __aenter__(self):
737
746
  return self
@@ -1,5 +1,6 @@
1
1
  from datetime import datetime
2
- from typing import List, Optional, Dict, Any
2
+ from typing import List, Optional, Any
3
+
3
4
  from pydantic import BaseModel, Field, ConfigDict
4
5
 
5
6
 
@@ -1,5 +1,3 @@
1
- import json
2
-
3
1
  from ey_commerce_lib.dxm.schemas.dxm_commodity_product import ViewDxmCommodityProductResponse, EditObj
4
2
  from ey_commerce_lib.utils.float import truncate_decimal_str
5
3
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ey-commerce-lib
3
- Version: 1.0.15
3
+ Version: 1.0.16
4
4
  Summary: eeyoung电商客户端调用封装
5
5
  Author-email: 饶奇奇 <1124393197@qq.com>
6
6
  Requires-Python: >=3.10
@@ -2,7 +2,7 @@ ey_commerce_lib/__init__.py,sha256=QTYqXqSTHFRkM9TEgpDFcHvwLbvqHDqvqfQ9EiXkcAM,2
2
2
  ey_commerce_lib/model.py,sha256=0ZCE68502blzRDsQ38AIswc8kPk7H34Am5x8IiDi2DU,232
3
3
  ey_commerce_lib/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  ey_commerce_lib/dxm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- ey_commerce_lib/dxm/main.py,sha256=mwbwshZcY-pzIilRDDw_330KHXKHStCASv37T7S-LR4,28787
5
+ ey_commerce_lib/dxm/main.py,sha256=l37Byi4P6nxdMRQSdmcgjjxCKa3_FATQ3seqCgfiKQA,29208
6
6
  ey_commerce_lib/dxm/order.py,sha256=hMdNm9X5h9tbvMWFnyE5hcSF4butzn7m-akGqLQUD0k,35
7
7
  ey_commerce_lib/dxm/constant/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  ey_commerce_lib/dxm/constant/order.py,sha256=U-2NYnkIcqukzMtOFpfqvzIktu_t7jYEms_n9LgKMlY,2213
@@ -17,12 +17,12 @@ ey_commerce_lib/dxm/parser/purchase.py,sha256=lmcC41HtdUqCgGamFASPnzHatUziLFaenT
17
17
  ey_commerce_lib/dxm/parser/warehouse.py,sha256=oQVojPX8VKHUphdV1KY5ZK1PCFtOY2zwkyLNUeJ3JT0,3310
18
18
  ey_commerce_lib/dxm/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  ey_commerce_lib/dxm/schemas/common.py,sha256=ihCeYrh4K_-m9_4rVzHm-o8rFNqzcD5XkO0JQd2023g,234
20
- ey_commerce_lib/dxm/schemas/dxm_commodity_product.py,sha256=e48ojtOqNfnCaOyPLsBlv4AwfmfkBg62w7J2sA9l1E4,30875
20
+ ey_commerce_lib/dxm/schemas/dxm_commodity_product.py,sha256=9CiMTkRFk2McFL5jiHI35furvuxhJlqBr4AWOC3hlXw,30871
21
21
  ey_commerce_lib/dxm/schemas/ebay_product.py,sha256=k8LqBCz657vYRcLRjjyPJjQYjQOSwSGBivvp2LPWuYc,3696
22
22
  ey_commerce_lib/dxm/schemas/order.py,sha256=6ps9aXFcEiRASLv1CH5uW7wnplaWzD_vTfyzvi5eLE0,7881
23
23
  ey_commerce_lib/dxm/schemas/warehouse.py,sha256=BT9r92DgkGKRI-HPqHPt5FKPdPJr2h-rxjfh25STR2E,5094
24
24
  ey_commerce_lib/dxm/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
- ey_commerce_lib/dxm/utils/dxm_commodity_product.py,sha256=k7ANpQ0M2Tf94QO0xcQUpdBrjZN-pXVL--_s_wrwX5E,5413
25
+ ey_commerce_lib/dxm/utils/dxm_commodity_product.py,sha256=OkL9Ve0lnSA2l-3DMWXF2fSj-A0uV4ucrhfEWNL2Z-Y,5398
26
26
  ey_commerce_lib/dxm/utils/mark.py,sha256=rAmofi3JmdI8gdl3s-U0ZEKcA-cn6vtS3lsXDrVXRLc,4716
27
27
  ey_commerce_lib/four_seller/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
28
  ey_commerce_lib/four_seller/main.py,sha256=cqO29DRRVzJHwo_005RFOO3vyGboQcuJUli783nyQjA,13131
@@ -53,6 +53,6 @@ ey_commerce_lib/utils/dxm.py,sha256=jVNltK_Pm_yMzXReD0Aw5VW6kzIZ5Bn23RucS0DKBI0,
53
53
  ey_commerce_lib/utils/float.py,sha256=PiOMf9pRApc1DskKkhKx0LAWHAYTpAPT_G4QRZRd8ZU,905
54
54
  ey_commerce_lib/utils/list_util.py,sha256=R1w7B1m3sEXr38zSHWp-15C3xAs5ykYCCpvwmnRW4xs,545
55
55
  ey_commerce_lib/utils/str.py,sha256=939xE0y8U7KEWjwbEezMlaWJNBsfb2BSb-dBpYbOD8Q,138
56
- ey_commerce_lib-1.0.15.dist-info/METADATA,sha256=wVymcuISab9JO0cH3UkFtnrdP7iEWrDwHLvcFi6qCeA,391
57
- ey_commerce_lib-1.0.15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
58
- ey_commerce_lib-1.0.15.dist-info/RECORD,,
56
+ ey_commerce_lib-1.0.16.dist-info/METADATA,sha256=rDYDrnrc962sMDr66d9JP6oYHIkWALNSCbnYeKCzHkQ,391
57
+ ey_commerce_lib-1.0.16.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
58
+ ey_commerce_lib-1.0.16.dist-info/RECORD,,