gomyck-tools 1.1.6__py3-none-any.whl → 1.1.7__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.
- ctools/application.py +5 -6
- ctools/bottle_web_base.py +2 -2
- ctools/bottle_webserver.py +3 -4
- ctools/database.py +3 -0
- ctools/dict_wrapper.py +4 -1
- ctools/douglas_rarefy.py +3 -0
- ctools/html_soup.py +0 -7
- ctools/resource_bundle_tools.py +1 -1
- ctools/sign.py +1 -1
- ctools/sys_info.py +1 -1
- ctools/word_fill.py +1 -1
- {gomyck_tools-1.1.6.dist-info → gomyck_tools-1.1.7.dist-info}/METADATA +2 -1
- {gomyck_tools-1.1.6.dist-info → gomyck_tools-1.1.7.dist-info}/RECORD +15 -15
- {gomyck_tools-1.1.6.dist-info → gomyck_tools-1.1.7.dist-info}/WHEEL +0 -0
- {gomyck_tools-1.1.6.dist-info → gomyck_tools-1.1.7.dist-info}/top_level.txt +0 -0
ctools/application.py
CHANGED
@@ -23,10 +23,9 @@ class Server:
|
|
23
23
|
metricsPort = 8011 # 获取指标信息端口
|
24
24
|
wsPort = 8012 # websocket服务端口
|
25
25
|
startTime = time.time() # 系统启动时间
|
26
|
-
baseWorkPath = work_path.get_user_work_path('
|
26
|
+
baseWorkPath = work_path.get_user_work_path('rpa') # 基础的工作目录
|
27
27
|
sysLogPath = os.path.join(baseWorkPath, ".logs") # 系统日志存储目录
|
28
28
|
pythonHome = os.path.join(work_path.get_Users_path(), 'Public/python-3.8.9') # python根目录
|
29
|
-
hylinkFunctionPath = os.path.join(pythonHome, "Lib", "site-packages", "hylink")
|
30
29
|
indicatorsPath = os.path.join(baseWorkPath, "indicators") # 指标信息存储目录
|
31
30
|
screenshotPath = os.path.join(baseWorkPath, "screenshot") # 截图存储目录
|
32
31
|
controlServerAddr = None
|
@@ -117,10 +116,10 @@ def check_database():
|
|
117
116
|
if db_size < 2000 * 1024: os.remove(db_file)
|
118
117
|
|
119
118
|
def validate_sign():
|
120
|
-
sign_app_val = sign.generate_signature(work_path.get_install_path('
|
121
|
-
with open(work_path.get_install_path('
|
119
|
+
sign_app_val = sign.generate_signature(work_path.get_install_path('rpa-server.exe'))
|
120
|
+
with open(work_path.get_install_path('rpa-server.sign')) as sign_file:
|
122
121
|
sign_file_val = sign_file.readline()
|
123
|
-
if '
|
122
|
+
if 'rpa-dev-sign' == sign_file_val.strip(): return
|
124
123
|
if sign_app_val != sign_file_val: raise Exception('程序签名验证失败!!!')
|
125
124
|
|
126
125
|
|
@@ -349,7 +348,7 @@ def sync_paddleocr_model():
|
|
349
348
|
print('安装paddleocr模型文件结束')
|
350
349
|
|
351
350
|
|
352
|
-
def clean_temp_dir(target_file='
|
351
|
+
def clean_temp_dir(target_file='rpa_ident'):
|
353
352
|
root_folder = work_path.get_user_temp_path()
|
354
353
|
print("Start clear cache...")
|
355
354
|
for folder_name in os.listdir(root_folder):
|
ctools/bottle_web_base.py
CHANGED
@@ -22,7 +22,7 @@ class GlobalState:
|
|
22
22
|
]
|
23
23
|
token = {}
|
24
24
|
|
25
|
-
def init_app(context_path):
|
25
|
+
def init_app(context_path=None):
|
26
26
|
app = Bottle()
|
27
27
|
app.context_path = context_path
|
28
28
|
|
@@ -87,7 +87,7 @@ def rule(key):
|
|
87
87
|
return decorated
|
88
88
|
return return_func
|
89
89
|
|
90
|
-
# annotation or plugins
|
90
|
+
# annotation or plugins, has auto install, don't need to call
|
91
91
|
def params_resolve(func):
|
92
92
|
@wraps(func)
|
93
93
|
def decorated(*args, **kwargs):
|
ctools/bottle_webserver.py
CHANGED
@@ -4,12 +4,11 @@ from wsgiref.simple_server import WSGIServer, WSGIRequestHandler, make_server
|
|
4
4
|
from bottle import ServerAdapter, Bottle, template, static_file
|
5
5
|
|
6
6
|
"""
|
7
|
-
app = init_app('
|
7
|
+
app = bottle_web_base.init_app('子模块写 context_path, 主模块就不用写任何东西')
|
8
8
|
|
9
9
|
@app.get('/queryList')
|
10
|
-
@
|
11
|
-
|
12
|
-
def query_list(params, pageInfo):
|
10
|
+
@bottle_web_base.rule('DOC:DOWNLOAD')
|
11
|
+
def query_list(params):
|
13
12
|
"""
|
14
13
|
|
15
14
|
"""
|
ctools/database.py
CHANGED
@@ -33,6 +33,9 @@ def _init():
|
|
33
33
|
# 密码里的@ 要替换成 %40
|
34
34
|
# sqlite connect_args={"check_same_thread": False} sqlite:///{}.format(db_url)
|
35
35
|
def init_db(db_url: str, db_key: str='default', connect_args: dict={}, default_schema: str=None, pool_size: int=5, max_overflow: int=25, echo: bool=False):
|
36
|
+
if db_url.startswith('mysql'):
|
37
|
+
import pymysql
|
38
|
+
pymysql.install_as_MySQLdb()
|
36
39
|
if inited_db.get(db_key): raise Exception('db {} already init!!!'.format(db_key))
|
37
40
|
global engines, sessionMakers
|
38
41
|
engine, sessionMaker = _create_connection(db_url=db_url, connect_args=connect_args, pool_size=pool_size, max_overflow=max_overflow, echo=echo)
|
ctools/dict_wrapper.py
CHANGED
@@ -5,7 +5,10 @@ __date__ = '2024/10/25 09:42'
|
|
5
5
|
|
6
6
|
class DictWrapper(dict):
|
7
7
|
def __getattr__(self, key):
|
8
|
-
|
8
|
+
res = self.get(key)
|
9
|
+
if type(res) == dict:
|
10
|
+
return DictWrapper(res)
|
11
|
+
return res
|
9
12
|
|
10
13
|
def __setattr__(self, key, value):
|
11
14
|
self[key] = value
|
ctools/douglas_rarefy.py
CHANGED
ctools/html_soup.py
CHANGED
@@ -33,10 +33,3 @@ def table2list(html, include_header=True, recursive_find=True,
|
|
33
33
|
row = [i.text for i in td]
|
34
34
|
rows.append(row)
|
35
35
|
return rows
|
36
|
-
|
37
|
-
|
38
|
-
for e in table2list(open(r'C:\Users\hylink\Desktop\A-DESC.txt', encoding='utf-8'), table_attrs={'class_': '123'}):
|
39
|
-
print(e)
|
40
|
-
|
41
|
-
for e in table2list(open(r'C:\Users\hylink\Desktop\DEMO.txt', encoding='utf-8'), recursive_find=False, header_cell_tag='div', table_tag='div', table_class='table', row_tag='div', cell_tag='div'):
|
42
|
-
print(e)
|
ctools/resource_bundle_tools.py
CHANGED
ctools/sign.py
CHANGED
ctools/sys_info.py
CHANGED
ctools/word_fill.py
CHANGED
@@ -494,7 +494,7 @@ def excel_optimize(input_path: str):
|
|
494
494
|
|
495
495
|
|
496
496
|
# 示例用法:从第1行到第5行、从第1列到第3列的区域复制到Word文档中
|
497
|
-
# excel_file = r'C:\Users\DELL\
|
497
|
+
# excel_file = r'C:\Users\DELL\xxx/xxx-rpa/document\test-2024-04-01_09-05-26.xlsx' # Excel文件名
|
498
498
|
# excel_file_1 = r'E:\test\c.xlsx' # Excel文件名
|
499
499
|
# excel_file_2 = r'E:\test\b.xlsx' # Excel文件名
|
500
500
|
# word_file = r'E:\test\test.docx' # 输出Word文件名
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: gomyck-tools
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.7
|
4
4
|
Summary: A ctools for python development by hao474798383
|
5
5
|
Home-page: https://blog.gomyck.com
|
6
6
|
Author: gomyck
|
@@ -25,5 +25,6 @@ Requires-Dist: kafka-python ==2.0.2
|
|
25
25
|
Requires-Dist: bs4 ==0.0.2
|
26
26
|
Requires-Dist: paho-mqtt ==2.1.0
|
27
27
|
Requires-Dist: fuzzywuzzy ==0.18.0
|
28
|
+
Requires-Dist: pymysql ==1.1.1
|
28
29
|
|
29
30
|
this package is for python development
|
@@ -1,11 +1,11 @@
|
|
1
1
|
ctools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
ctools/aes_tools.py,sha256=ylUgyhlx7bNCTGrbWEZVwCObzYdJTQtwEc4ZMidL2Fo,563
|
3
3
|
ctools/api_result.py,sha256=NiM-R9K42G3m16B27sG_mqKrlexZzC5-LKoY8D5tO4s,1239
|
4
|
-
ctools/application.py,sha256=
|
4
|
+
ctools/application.py,sha256=DcuSt2m8cDuSftx6eKfJ5gA6_F9dDlzkj0K86EG4F7s,15884
|
5
5
|
ctools/b64.py,sha256=_BdhX3p3-MaSSlU2wivN5qPxQfacR3VRBr1WC456tU0,194
|
6
6
|
ctools/bashPath.py,sha256=BCN_EhYzqvwsxYso81omMNd3SbEociwSOyb9kLvu8V4,337
|
7
|
-
ctools/bottle_web_base.py,sha256=
|
8
|
-
ctools/bottle_webserver.py,sha256=
|
7
|
+
ctools/bottle_web_base.py,sha256=7hXCh2gkw2Nct6U_jweW_5qCtGB6iXcgmsnMVr4_pzE,4898
|
8
|
+
ctools/bottle_webserver.py,sha256=ewqio5uKmYsvbTroidB7ZQ8XZm5Dmc2jWHpoqb4pIDI,2499
|
9
9
|
ctools/bottle_websocket.py,sha256=IRY17SpDFjihLeU8c_aUIMAfUNZzurqfrOyNFojOQHQ,1858
|
10
10
|
ctools/browser_element_tools.py,sha256=IFR_tWu5on0LxhuC_4yT6EOjwCsC-juIoU8KQRDqR7E,9952
|
11
11
|
ctools/call.py,sha256=BCr8wzt5qd70okv8IZn-9-EpjywleZgvA3u1vfZ_Kt8,1581
|
@@ -14,15 +14,15 @@ ctools/ckafka.py,sha256=jD9n9sscKrU5spDlPGco681jhqVGRIXqwPiJUas3gpo,5965
|
|
14
14
|
ctools/compile_tools.py,sha256=Nybh3vnkurIKnPnubdYzigjnzFu4GaTMKPvqFdibxmE,510
|
15
15
|
ctools/console.py,sha256=EZumuyynwteKUhUxB_XoulHswDxHd75OQB34RiZ-OBM,1807
|
16
16
|
ctools/cron_lite.py,sha256=f9g7-64GsCxcAW-HUAvT6S-kooScl8zaJyqwHY-X_rE,8308
|
17
|
-
ctools/database.py,sha256=
|
17
|
+
ctools/database.py,sha256=7YzkO2tzV1KUQLHND8g9PkQwTyGd3clhgPiZ5SbC-HA,5447
|
18
18
|
ctools/date_utils.py,sha256=-xI2anEzAonOvYwVmM1hCnkuLKodZ8pb33dS3dRxEIc,865
|
19
|
-
ctools/dict_wrapper.py,sha256=
|
20
|
-
ctools/douglas_rarefy.py,sha256=
|
19
|
+
ctools/dict_wrapper.py,sha256=A6EOcI-aeYpK3yi6KmCkzShWG0gQcMmQV2lIWPzvn2U,310
|
20
|
+
ctools/douglas_rarefy.py,sha256=43WRjGGsQ_o1yPEXypA1Xv_yuo90RVo7qaYGRslx5gQ,4890
|
21
21
|
ctools/download_tools.py,sha256=oJbG12Hojd0J17sAlvMU480P3abi4_AB9oZkEBGFPuo,1930
|
22
22
|
ctools/enums.py,sha256=QbHa3j7j4-BDdwaga5Y0nYfA2uNSVJDHumYdIZdKVkM,118
|
23
23
|
ctools/ex.py,sha256=_UtbmDLrC7uZsoBtTdecuCZAlf2DA7fvojUf5fGZDVo,795
|
24
24
|
ctools/excelOpt.py,sha256=q3HLAb1JScTrMCvx_x-4WWnqKhyTEzQ-m5vtqFy8NZU,1138
|
25
|
-
ctools/html_soup.py,sha256=
|
25
|
+
ctools/html_soup.py,sha256=rnr8M3gn3gQGo-wNaNFXDjdzp8AAkv9o4yqfIIfO-zw,1567
|
26
26
|
ctools/http_utils.py,sha256=dG26aci1_YxAyKwYqMKFw4wZAryLkDyvnQ3hURjB6Lk,768
|
27
27
|
ctools/id_worker_tools.py,sha256=M4ehNKbVIrBhPs-GlVKEZ43WQArNb9s4UoVGgRit4YM,2356
|
28
28
|
ctools/images_tools.py,sha256=TapXYCPqC7GesgrALecxxa_ApuT_dxUG5fqQIJF2bNY,670
|
@@ -35,23 +35,23 @@ ctools/pacth.py,sha256=MJ9Du-J9Gv62y4cZKls1jKbl5a5kL2y9bD-gzYUCveQ,2604
|
|
35
35
|
ctools/plan_area_tools.py,sha256=pySri43bVfkHjzlKujML-Nk8B3QLxuYv5KJMha-MLmU,3311
|
36
36
|
ctools/process_pool.py,sha256=1TuZySUbQjgYYcuwis54DIwQTimWvTLNahSra7Ia8Ps,951
|
37
37
|
ctools/pty_tools.py,sha256=KI3dOyv2JLZmU1VfD1aLMq9r9d5VCu3TdtcezZayBEI,1622
|
38
|
-
ctools/resource_bundle_tools.py,sha256=
|
38
|
+
ctools/resource_bundle_tools.py,sha256=wA4fmD_ZEcrpcvUZKa60uDDX-nNQSVz1nBh0A2GVuTI,3796
|
39
39
|
ctools/screenshot_tools.py,sha256=KoljfgqW5x9aLwKdIfz0vR6v-fX4XjE92HudkDxC2hE,4539
|
40
|
-
ctools/sign.py,sha256=
|
40
|
+
ctools/sign.py,sha256=JOkgpgsMbk7T3c3MOj1U6eiEndUG9XQ-uIX9e615A_Y,566
|
41
41
|
ctools/sm_tools.py,sha256=RwhTjuKw_TjaAJAui39wctzFFpbt79MQ3hjF0fhL638,1113
|
42
42
|
ctools/strDiff.py,sha256=QUtXOfsRLTFozH_zByqsC39JeuG3eZtrwGVeLyaHYUI,429
|
43
43
|
ctools/string_tools.py,sha256=WlLQxQePbYVzvPi0YFGpTbHLQl9eRhHrX-DPkN4zMzg,2162
|
44
|
-
ctools/sys_info.py,sha256=
|
44
|
+
ctools/sys_info.py,sha256=QJSF-qbT2JlEVE4CVPxPbGdxo4UD7vSLoJpJcFCmmyc,3626
|
45
45
|
ctools/sys_log.py,sha256=oqb1S41LosdeZxtogFVgDk8R4sjiHhUeYJLCzHd728E,2805
|
46
46
|
ctools/thread_pool.py,sha256=qb68ULHy1K7u3MC7WP49wDhmgUhgWazd9FRuFbClET4,925
|
47
47
|
ctools/upload_tools.py,sha256=sqe6K3ZWiyY58pFE5IO5mNaS1znnS7U4c4UqY8noED4,1068
|
48
48
|
ctools/win_canvas.py,sha256=PAxI4i1jalfree9d1YG4damjc2EzaHZrgHZCTgk2GiM,2530
|
49
49
|
ctools/win_control.py,sha256=35f9x_ijSyc4ZDkcT32e9ZIhr_ffNxadynrQfFuIdYo,3489
|
50
50
|
ctools/wordFill.py,sha256=dB1OLt6GLmWdkDV8H20VWbJmY4ggNNI8iHD1ocae2iM,875
|
51
|
-
ctools/word_fill.py,sha256=
|
51
|
+
ctools/word_fill.py,sha256=xeo-P4DOjQUqd-o9XL3g66wQrE2diUPGwFywm8TdVyw,18210
|
52
52
|
ctools/word_fill_entity.py,sha256=eX3G0Gy16hfGpavQSEkCIoKDdTnNgRRJrFvKliETZK8,985
|
53
53
|
ctools/work_path.py,sha256=i4MTUobqNW2WMrT3mwEC_XYQ0_IhFmKoNpTX2W6A8Tc,1680
|
54
|
-
gomyck_tools-1.1.
|
55
|
-
gomyck_tools-1.1.
|
56
|
-
gomyck_tools-1.1.
|
57
|
-
gomyck_tools-1.1.
|
54
|
+
gomyck_tools-1.1.7.dist-info/METADATA,sha256=zK86gbG9wduQPYV5Ppdx9JAmEooAK7ts0VA_-lNsRXQ,971
|
55
|
+
gomyck_tools-1.1.7.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
56
|
+
gomyck_tools-1.1.7.dist-info/top_level.txt,sha256=-MiIH9FYRVKp1i5_SVRkaI-71WmF1sZSRrNWFU9ls3s,7
|
57
|
+
gomyck_tools-1.1.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|