mangoautomation 1.1.23__tar.gz → 1.1.24__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 mangoautomation might be problematic. Click here for more details.

Files changed (61) hide show
  1. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/PKG-INFO +10 -2
  2. mangoautomation-1.1.24/mangoautomation/mangos/__pycache__/__init__.cpython-310.pyc +0 -0
  3. mangoautomation-1.1.24/mangoautomation/mangos/mangos.cp310-win_amd64.pyd +0 -0
  4. mangoautomation-1.1.24/mangoautomation/mangos/mangos.cp312-win_amd64.pyd +0 -0
  5. mangoautomation-1.1.24/mangoautomation/mangos/mangos.cpython-310-darwin.so +0 -0
  6. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/mangos/mangos.cpython-310-x86_64-linux-gnu.so +0 -0
  7. mangoautomation-1.1.24/mangoautomation/mangos/mangos.cpython-312-darwin.so +0 -0
  8. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/mangos/mangos.cpython-312-x86_64-linux-gnu.so +0 -0
  9. mangoautomation-1.1.24/mangoautomation/uidrives/_driver_object.py +33 -0
  10. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation.egg-info/PKG-INFO +10 -2
  11. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/setup.py +1 -1
  12. mangoautomation-1.1.24/tests/demo1.py +94 -0
  13. mangoautomation-1.1.24/tests/get_ope.py +17 -0
  14. mangoautomation-1.1.23/mangoautomation/mangos/__pycache__/__init__.cpython-310.pyc +0 -0
  15. mangoautomation-1.1.23/mangoautomation/mangos/mangos.cp310-win_amd64.pyd +0 -0
  16. mangoautomation-1.1.23/mangoautomation/mangos/mangos.cp312-win_amd64.pyd +0 -0
  17. mangoautomation-1.1.23/mangoautomation/mangos/mangos.cpython-310-darwin.so +0 -0
  18. mangoautomation-1.1.23/mangoautomation/mangos/mangos.cpython-312-darwin.so +0 -0
  19. mangoautomation-1.1.23/mangoautomation/uidrives/_driver_object.py +0 -64
  20. mangoautomation-1.1.23/tests/demo1.py +0 -21
  21. mangoautomation-1.1.23/tests/get_ope.py +0 -8
  22. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/LICENSE +0 -0
  23. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/README.md +0 -0
  24. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/__init__.py +0 -0
  25. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/enums/__init__.py +0 -0
  26. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/enums/_base_enum.py +0 -0
  27. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/enums/_ui_enum.py +0 -0
  28. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/exceptions/__init__.py +0 -0
  29. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/exceptions/_exceptions.py +0 -0
  30. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/exceptions/error_msg.py +0 -0
  31. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/mangos/__init__.py +0 -0
  32. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/models/__init__.py +0 -0
  33. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/models/_ui_model.py +0 -0
  34. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/tools/__init__.py +0 -0
  35. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/tools/_mate.py +0 -0
  36. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/tools/_uiautodev.py +0 -0
  37. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/uidrive/__init__.py +0 -0
  38. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/uidrives/__init__.py +0 -0
  39. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/uidrives/_async_element.py +0 -0
  40. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/uidrives/_base_data.py +0 -0
  41. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/uidrives/_sync_element.py +0 -0
  42. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/uidrives/android/__init__.py +0 -0
  43. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/uidrives/ios/__init__.py +0 -0
  44. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/uidrives/pc/__init__.py +0 -0
  45. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/uidrives/pc/assertion.py +0 -0
  46. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/uidrives/pc/customization.py +0 -0
  47. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/uidrives/pc/element.py +0 -0
  48. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/uidrives/pc/input_device.py +0 -0
  49. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/uidrives/pc/new_windows.py +0 -0
  50. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/uidrives/web/__init__.py +0 -0
  51. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/uidrives/web/_async_web.py +0 -0
  52. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation/uidrives/web/_sync_web.py +0 -0
  53. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation.egg-info/SOURCES.txt +0 -0
  54. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation.egg-info/dependency_links.txt +0 -0
  55. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation.egg-info/requires.txt +0 -0
  56. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/mangoautomation.egg-info/top_level.txt +0 -0
  57. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/setup.cfg +0 -0
  58. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/tests/__init__.py +0 -0
  59. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/tests/test_ai_element.py +0 -0
  60. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/tests/test_ui_and.py +0 -0
  61. {mangoautomation-1.1.23 → mangoautomation-1.1.24}/tests/test_ui_web.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: mangoautomation
3
- Version: 1.1.23
3
+ Version: 1.1.24
4
4
  Summary: 测试工具
5
5
  Home-page: https://gitee.com/mao-peng/testkit
6
6
  Author: 毛鹏
@@ -18,6 +18,14 @@ Requires-Dist: adbutils~=2.8.9
18
18
  Requires-Dist: uiautodev>=0.9.0
19
19
  Requires-Dist: beautifulsoup4==4.14.2
20
20
  Requires-Dist: openai==2.6.1
21
+ Dynamic: author
22
+ Dynamic: author-email
23
+ Dynamic: classifier
24
+ Dynamic: description
25
+ Dynamic: home-page
26
+ Dynamic: license-file
27
+ Dynamic: requires-dist
28
+ Dynamic: summary
21
29
 
22
30
  # testkit
23
31
 
@@ -0,0 +1,33 @@
1
+ # -*- coding: utf-8 -*-
2
+ # @Project: 芒果测试平台
3
+ # @Description:
4
+ # @Time : 2024-04-24 10:43
5
+ # @Author : 毛鹏
6
+
7
+ from typing import Optional
8
+ from mangoautomation.mangos import NewAndroid, AsyncWebNewBrowser, SyncWebNewBrowser
9
+ from ..uidrives.pc.new_windows import NewWindows
10
+
11
+
12
+
13
+ class DriverObject:
14
+
15
+ def __init__(self, log, is_async=False):
16
+ self.log = log
17
+ self.is_async = is_async
18
+ self.web: Optional[AsyncWebNewBrowser | SyncWebNewBrowser] = None
19
+ self.android: Optional[NewAndroid] = None
20
+ self.windows: Optional[NewWindows] = None
21
+
22
+ def set_web(self, **kwargs):
23
+ kwargs['log'] = self.log
24
+ if self.is_async:
25
+ self.web = AsyncWebNewBrowser(**kwargs)
26
+ else:
27
+ self.web = SyncWebNewBrowser(**kwargs)
28
+
29
+ def set_android(self, and_equipment: str):
30
+ self.android = NewAndroid(and_equipment)
31
+
32
+ def set_windows(self, win_path: str, win_title: str):
33
+ self.windows = NewWindows(win_path, win_title)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: mangoautomation
3
- Version: 1.1.23
3
+ Version: 1.1.24
4
4
  Summary: 测试工具
5
5
  Home-page: https://gitee.com/mao-peng/testkit
6
6
  Author: 毛鹏
@@ -18,6 +18,14 @@ Requires-Dist: adbutils~=2.8.9
18
18
  Requires-Dist: uiautodev>=0.9.0
19
19
  Requires-Dist: beautifulsoup4==4.14.2
20
20
  Requires-Dist: openai==2.6.1
21
+ Dynamic: author
22
+ Dynamic: author-email
23
+ Dynamic: classifier
24
+ Dynamic: description
25
+ Dynamic: home-page
26
+ Dynamic: license-file
27
+ Dynamic: requires-dist
28
+ Dynamic: summary
21
29
 
22
30
  # testkit
23
31
 
@@ -1,6 +1,6 @@
1
1
  from setuptools import setup, find_packages
2
2
 
3
- __version__ = '1.1.23'
3
+ __version__ = '1.1.24'
4
4
 
5
5
  with open("README.md", "r", encoding='utf-8') as fh:
6
6
  long_description = fh.read()
@@ -0,0 +1,94 @@
1
+ from bs4 import BeautifulSoup
2
+
3
+
4
+ def get_optimized_page_html(html_content) -> str:
5
+ soup = BeautifulSoup(html_content, 'html.parser')
6
+
7
+ # 配置化的清理规则
8
+ cleanup_rules = {
9
+ # 直接删除的标签
10
+ 'remove_tags': [
11
+ 'script', 'style', 'link', 'noscript', 'path',
12
+ 'svg', 'head', 'symbol', 'doubao-ai-csui', 'template'
13
+ ],
14
+
15
+ # 按class删除的元素
16
+ 'remove_by_class': [
17
+ 'watermark-box'
18
+ ],
19
+
20
+ # 按属性删除的元素
21
+ 'remove_by_attrs': {
22
+ # 'tag_name': {'attr': 'value'}
23
+ },
24
+
25
+ # 清空内容但保留标签的条件
26
+ 'empty_content_conditions': [
27
+ {
28
+ 'tag': 'textarea',
29
+ 'condition': lambda el: el.get('style') and 'display:none' in el.get('style')
30
+ }
31
+ ],
32
+
33
+ # 要删除的属性
34
+ 'remove_attributes': [
35
+ 'style',
36
+ 'ssr'
37
+ ],
38
+
39
+ # 要删除的属性前缀(包含该前缀的属性都会被删除)
40
+ 'remove_attribute_prefixes': [
41
+ 'data-v-',
42
+ 'data-testid'
43
+ ]
44
+ }
45
+
46
+ # 执行清理规则
47
+ # 1. 删除指定标签
48
+ for tag_name in cleanup_rules['remove_tags']:
49
+ for element in soup.find_all(tag_name):
50
+ element.decompose()
51
+
52
+ # 2. 按class删除元素
53
+ for class_name in cleanup_rules['remove_by_class']:
54
+ for element in soup.find_all(class_=class_name):
55
+ element.decompose()
56
+
57
+ # 3. 按属性删除元素
58
+ for tag_name, attrs in cleanup_rules['remove_by_attrs'].items():
59
+ for element in soup.find_all(tag_name, attrs=attrs):
60
+ element.decompose()
61
+
62
+ # 4. 清空特定元素内容
63
+ for condition_config in cleanup_rules['empty_content_conditions']:
64
+ tag = condition_config['tag']
65
+ condition_func = condition_config['condition']
66
+ for element in soup.find_all(tag):
67
+ if condition_func(element):
68
+ element.string = ''
69
+
70
+ # 5. 删除属性和属性前缀
71
+ for element in soup.find_all():
72
+ # 删除指定属性
73
+ for attr in cleanup_rules['remove_attributes']:
74
+ if element.has_attr(attr):
75
+ del element[attr]
76
+
77
+ # 删除包含特定前缀的属性
78
+ for attr_prefix in cleanup_rules['remove_attribute_prefixes']:
79
+ for attr in list(element.attrs.keys()):
80
+ if attr.startswith(attr_prefix):
81
+ del element[attr]
82
+
83
+ # 将BeautifulSoup对象转换为字符串
84
+ html_content_str = str(soup)
85
+ return html_content_str
86
+
87
+
88
+ with open('element.txt', 'r', encoding='utf-8') as f:
89
+ file_content = f.read()
90
+ optimize = get_optimized_page_html(file_content)
91
+ print(f'原始的html大小:{len(file_content)}')
92
+ print(f'优化之后的html大小:{len(optimize)}')
93
+ with open('optimized.html', 'w', encoding='utf-8') as f:
94
+ f.write(optimize)
@@ -0,0 +1,17 @@
1
+ # -*- coding: utf-8 -*-
2
+ # @Project: 芒果测试平台
3
+ # @Description:
4
+ # @Time : 2025-08-31 17:41
5
+ # @Author : 毛鹏
6
+ from mangoautomation.uidrive import DriverObject
7
+
8
+ d = DriverObject(1, )
9
+ d.set_web(web_type=2, # type: ignore
10
+ web_path=3, # type: ignore
11
+ web_max=1,
12
+ web_headers=4,
13
+ web_recording=5,
14
+ web_h5=1,
15
+ web_is_default=1, # type: ignore
16
+ videos_path=2,
17
+ user_cache_path=3)
@@ -1,64 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # @Project: 芒果测试平台
3
- # @Description:
4
- # @Time : 2024-04-24 10:43
5
- # @Author : 毛鹏
6
-
7
- from typing import Optional
8
- from mangoautomation.mangos import NewAndroid, AsyncWebNewBrowser, SyncWebNewBrowser
9
- from ..uidrives.pc.new_windows import NewWindows
10
-
11
-
12
-
13
- class DriverObject:
14
-
15
- def __init__(self, log, is_async=False):
16
- self.log = log
17
- self.is_async = is_async
18
- self.web: Optional[AsyncWebNewBrowser | SyncWebNewBrowser] = None
19
- self.android: Optional[NewAndroid] = None
20
- self.windows: Optional[NewWindows] = None
21
-
22
- def set_web(self,
23
- web_type: int,
24
- web_path: str | None = None,
25
- web_max=False,
26
- web_headers=False,
27
- web_recording=False,
28
- web_h5=None,
29
- is_header_intercept=False,
30
- web_is_default=False,
31
- videos_path=None
32
- ):
33
- if self.is_async:
34
- self.web = AsyncWebNewBrowser(
35
- web_type,
36
- web_path,
37
- web_max,
38
- web_headers,
39
- web_recording,
40
- web_h5,
41
- is_header_intercept,
42
- web_is_default,
43
- videos_path,
44
- log=self.log,
45
- )
46
- else:
47
- self.web = SyncWebNewBrowser(
48
- web_type,
49
- web_path,
50
- web_max,
51
- web_headers,
52
- web_recording,
53
- web_h5,
54
- is_header_intercept,
55
- web_is_default,
56
- videos_path,
57
- log=self.log,
58
- )
59
-
60
- def set_android(self, and_equipment: str):
61
- self.android = NewAndroid(and_equipment)
62
-
63
- def set_windows(self, win_path: str, win_title: str):
64
- self.windows = NewWindows(win_path, win_title)
@@ -1,21 +0,0 @@
1
- from openai import OpenAI
2
-
3
- client = OpenAI(api_key="sk-rruuhjnqawsvduyxlcqckbtgwkprctgkvwcelenooixbhthy",
4
- base_url="https://api.siliconflow.cn/v1")
5
- response = client.chat.completions.create(
6
- # model='Pro/deepseek-ai/DeepSeek-R1',
7
- model="THUDM/GLM-Z1-9B-0414",
8
- messages=[
9
- {'role': 'user',
10
- 'content': "推理模型会给市场带来哪些新的机会"}
11
- ],
12
- stream=True
13
- )
14
-
15
- for chunk in response:
16
- if not chunk.choices:
17
- continue
18
- if chunk.choices[0].delta.content:
19
- print(chunk.choices[0].delta.content, end="", flush=True)
20
- if chunk.choices[0].delta.reasoning_content:
21
- print(chunk.choices[0].delta.reasoning_content, end="", flush=True)
@@ -1,8 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # @Project: 芒果测试平台
3
- # @Description:
4
- # @Time : 2025-08-31 17:41
5
- # @Author : 毛鹏
6
- loc = 'await page.cdeadapage.'
7
- cleaned_loc = loc.replace('page.', '').replace('await', '')
8
- print(cleaned_loc)