gomyck-tools 1.1.9__py3-none-any.whl → 1.2.0__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/bottle_webserver.py +2 -1
- ctools/bottle_websocket.py +3 -2
- ctools/{id_worker_tools.py → snow_id.py} +2 -6
- ctools/string_tools.py +2 -16
- {gomyck_tools-1.1.9.dist-info → gomyck_tools-1.2.0.dist-info}/METADATA +9 -9
- {gomyck_tools-1.1.9.dist-info → gomyck_tools-1.2.0.dist-info}/RECORD +8 -8
- {gomyck_tools-1.1.9.dist-info → gomyck_tools-1.2.0.dist-info}/WHEEL +0 -0
- {gomyck_tools-1.1.9.dist-info → gomyck_tools-1.2.0.dist-info}/top_level.txt +0 -0
ctools/bottle_webserver.py
CHANGED
@@ -9,6 +9,7 @@ app = bottle_web_base.init_app('子模块写 context_path, 主模块就不用写
|
|
9
9
|
@app.get('/queryList')
|
10
10
|
@bottle_web_base.rule('DOC:DOWNLOAD')
|
11
11
|
def query_list(params):
|
12
|
+
print(123)
|
12
13
|
"""
|
13
14
|
|
14
15
|
"""
|
@@ -27,7 +28,7 @@ def get_ws_modules():
|
|
27
28
|
"""
|
28
29
|
|
29
30
|
"""
|
30
|
-
http_app = bottle_webserver.init_bottle()
|
31
|
+
http_app = bottle_webserver.init_bottle() # 这里可以传 APP 当做主模块
|
31
32
|
http_app.mount(app.context_path, app)
|
32
33
|
http_app.set_index(r'轨迹点位压缩.html')
|
33
34
|
http_app.run()
|
ctools/bottle_websocket.py
CHANGED
@@ -4,11 +4,12 @@ from geventwebsocket.handler import WebSocketHandler
|
|
4
4
|
from ctools import sys_log
|
5
5
|
|
6
6
|
"""
|
7
|
-
app = init_app('/websocket_demo')
|
7
|
+
app = bottle_web_base.init_app('/websocket_demo')
|
8
8
|
|
9
9
|
@app.route('/script_debug', apply=[websocket])
|
10
|
-
@rule('DOC:DOWNLOAD')
|
10
|
+
@bottle_web_base.rule('DOC:DOWNLOAD')
|
11
11
|
def script_debug(ws: WebSocket):
|
12
|
+
print(123)
|
12
13
|
"""
|
13
14
|
|
14
15
|
"""
|
@@ -16,11 +16,11 @@ SEQUENCE_MASK = -1 ^ (-1 << SEQUENCE_BITS)
|
|
16
16
|
# Twitter元年时间戳
|
17
17
|
TWEPOCH = 1288834974657
|
18
18
|
|
19
|
-
class
|
19
|
+
class SnowId(object):
|
20
20
|
"""
|
21
21
|
用于生成IDs
|
22
22
|
"""
|
23
|
-
def __init__(self, datacenter_id, worker_id, sequence=0):
|
23
|
+
def __init__(self, datacenter_id=0, worker_id=0, sequence=0):
|
24
24
|
"""
|
25
25
|
初始化
|
26
26
|
:param datacenter_id: 数据中心(机器区域)ID
|
@@ -74,7 +74,3 @@ class IdWorker(object):
|
|
74
74
|
while timestamp <= last_timestamp:
|
75
75
|
timestamp = self._gen_timestamp()
|
76
76
|
return timestamp
|
77
|
-
|
78
|
-
# if __name__ == '__main__':
|
79
|
-
# worker = IdWorker(1, 2, 0)
|
80
|
-
# print(worker.get_id())
|
ctools/string_tools.py
CHANGED
@@ -5,27 +5,19 @@ from typing import Union
|
|
5
5
|
|
6
6
|
import chardet
|
7
7
|
|
8
|
-
from ctools.
|
8
|
+
from ctools.snow_id import SnowId
|
9
9
|
|
10
|
-
idWorker =
|
10
|
+
idWorker = SnowId(1, 2, 0)
|
11
11
|
|
12
12
|
def get_random_str(size: int = 10):
|
13
|
-
"""
|
14
|
-
根据长度获取随机字符串
|
15
|
-
:param size:
|
16
|
-
:return:
|
17
|
-
"""
|
18
13
|
return "".join(random.sample('abcdefghijklmnopqrstuvwxyz0123456789', size))
|
19
14
|
|
20
|
-
|
21
15
|
def get_uuid():
|
22
16
|
return str(uuid.uuid1()).replace("-", "")
|
23
17
|
|
24
|
-
|
25
18
|
def get_snowflake_id():
|
26
19
|
return idWorker.get_id()
|
27
20
|
|
28
|
-
|
29
21
|
def decode_bytes(bytes_str: Union[bytes, bytearray]):
|
30
22
|
res_str = ""
|
31
23
|
if bytes_str:
|
@@ -80,12 +72,6 @@ def is_bool(v: str):
|
|
80
72
|
else:
|
81
73
|
return False
|
82
74
|
|
83
|
-
def is_obj(k: str):
|
84
|
-
if k in ['operate', 'pm_browser_sm_options', 'pw_context_sm_service']:
|
85
|
-
return True
|
86
|
-
else:
|
87
|
-
return False
|
88
|
-
|
89
75
|
def dict_to_params(obj: dict):
|
90
76
|
params = ""
|
91
77
|
for k, v in obj.items():
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: gomyck-tools
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.2.0
|
4
4
|
Summary: A ctools for python development by hao474798383
|
5
5
|
Home-page: https://blog.gomyck.com
|
6
6
|
Author: gomyck
|
@@ -10,17 +10,17 @@ Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
11
11
|
Requires-Python: >=3.8
|
12
12
|
Description-Content-Type: text/markdown
|
13
|
-
Requires-Dist: jsonpickle ==3.
|
14
|
-
Requires-Dist: SQLAlchemy >=2.0.
|
13
|
+
Requires-Dist: jsonpickle ==3.4.2
|
14
|
+
Requires-Dist: SQLAlchemy >=2.0.36
|
15
15
|
Requires-Dist: chardet >=5.2.0
|
16
|
-
Requires-Dist: psycopg2-binary >=2.9.
|
17
|
-
Requires-Dist: croniter >=
|
16
|
+
Requires-Dist: psycopg2-binary >=2.9.10
|
17
|
+
Requires-Dist: croniter >=5.0.1
|
18
18
|
Requires-Dist: gmssl >=3.2.2
|
19
|
-
Requires-Dist: psutil >=6.
|
20
|
-
Requires-Dist: jsonpath-ng >=1.
|
21
|
-
Requires-Dist: bottle ==0.13.
|
19
|
+
Requires-Dist: psutil >=6.1.0
|
20
|
+
Requires-Dist: jsonpath-ng >=1.7.0
|
21
|
+
Requires-Dist: bottle ==0.13.2
|
22
22
|
Requires-Dist: requests ==2.32.3
|
23
|
-
Requires-Dist: urllib3 ==1.26.
|
23
|
+
Requires-Dist: urllib3 ==1.26.20
|
24
24
|
Requires-Dist: kafka-python ==2.0.2
|
25
25
|
Requires-Dist: bs4 ==0.0.2
|
26
26
|
Requires-Dist: paho-mqtt ==2.1.0
|
@@ -5,8 +5,8 @@ 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
7
|
ctools/bottle_web_base.py,sha256=7hXCh2gkw2Nct6U_jweW_5qCtGB6iXcgmsnMVr4_pzE,4898
|
8
|
-
ctools/bottle_webserver.py,sha256=
|
9
|
-
ctools/bottle_websocket.py,sha256=
|
8
|
+
ctools/bottle_webserver.py,sha256=8w1oj6_P09an6Pdnr5dH9ClBiD-A6k27IBCSvqVfcTs,2550
|
9
|
+
ctools/bottle_websocket.py,sha256=wjsjKVE_tlon0hYfnzBT0Sis6yNPe318vKgTfzWYbfQ,1903
|
10
10
|
ctools/browser_element_tools.py,sha256=IFR_tWu5on0LxhuC_4yT6EOjwCsC-juIoU8KQRDqR7E,9952
|
11
11
|
ctools/call.py,sha256=BCr8wzt5qd70okv8IZn-9-EpjywleZgvA3u1vfZ_Kt8,1581
|
12
12
|
ctools/cjson.py,sha256=M2XrXnFXTJyKsXP2JRos2Bse4b6WXjr6TrA6y-EF_Ig,1245
|
@@ -24,7 +24,6 @@ ctools/ex.py,sha256=_UtbmDLrC7uZsoBtTdecuCZAlf2DA7fvojUf5fGZDVo,795
|
|
24
24
|
ctools/excelOpt.py,sha256=q3HLAb1JScTrMCvx_x-4WWnqKhyTEzQ-m5vtqFy8NZU,1138
|
25
25
|
ctools/html_soup.py,sha256=rnr8M3gn3gQGo-wNaNFXDjdzp8AAkv9o4yqfIIfO-zw,1567
|
26
26
|
ctools/http_utils.py,sha256=dG26aci1_YxAyKwYqMKFw4wZAryLkDyvnQ3hURjB6Lk,768
|
27
|
-
ctools/id_worker_tools.py,sha256=M4ehNKbVIrBhPs-GlVKEZ43WQArNb9s4UoVGgRit4YM,2356
|
28
27
|
ctools/images_tools.py,sha256=TapXYCPqC7GesgrALecxxa_ApuT_dxUG5fqQIJF2bNY,670
|
29
28
|
ctools/imgDialog.py,sha256=zFeyPmpnEn9Ih7-yuJJrePqW8Myj3jC9UYMTDk-umTs,1385
|
30
29
|
ctools/license.py,sha256=0Kh7lXL7LD1PQqyijHajFL0GbmZGNB88PA2WskbQn_s,1066
|
@@ -39,8 +38,9 @@ ctools/resource_bundle_tools.py,sha256=wA4fmD_ZEcrpcvUZKa60uDDX-nNQSVz1nBh0A2GVu
|
|
39
38
|
ctools/screenshot_tools.py,sha256=KoljfgqW5x9aLwKdIfz0vR6v-fX4XjE92HudkDxC2hE,4539
|
40
39
|
ctools/sign.py,sha256=JOkgpgsMbk7T3c3MOj1U6eiEndUG9XQ-uIX9e615A_Y,566
|
41
40
|
ctools/sm_tools.py,sha256=RwhTjuKw_TjaAJAui39wctzFFpbt79MQ3hjF0fhL638,1113
|
41
|
+
ctools/snow_id.py,sha256=hYinnRN-aOule4_9vfgXB7XnsU-56cIS3PhzAwWBc5E,2270
|
42
42
|
ctools/strDiff.py,sha256=QUtXOfsRLTFozH_zByqsC39JeuG3eZtrwGVeLyaHYUI,429
|
43
|
-
ctools/string_tools.py,sha256=
|
43
|
+
ctools/string_tools.py,sha256=p_O3HiqlHCgzJVXHUeeDYZK2_WrqetD0eYijQFXWkGg,1938
|
44
44
|
ctools/sys_info.py,sha256=p5Erxn0Rv5HRSXlqDt7ffIWCBQU66G-sdW6doMAeAks,3627
|
45
45
|
ctools/sys_log.py,sha256=oqb1S41LosdeZxtogFVgDk8R4sjiHhUeYJLCzHd728E,2805
|
46
46
|
ctools/thread_pool.py,sha256=qb68ULHy1K7u3MC7WP49wDhmgUhgWazd9FRuFbClET4,925
|
@@ -51,7 +51,7 @@ ctools/wordFill.py,sha256=dB1OLt6GLmWdkDV8H20VWbJmY4ggNNI8iHD1ocae2iM,875
|
|
51
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.
|
55
|
-
gomyck_tools-1.
|
56
|
-
gomyck_tools-1.
|
57
|
-
gomyck_tools-1.
|
54
|
+
gomyck_tools-1.2.0.dist-info/METADATA,sha256=fGkZEdcTWWnI6Nj3aEcuhexNSQaLlP9Wbte5bGEOIZc,972
|
55
|
+
gomyck_tools-1.2.0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
56
|
+
gomyck_tools-1.2.0.dist-info/top_level.txt,sha256=-MiIH9FYRVKp1i5_SVRkaI-71WmF1sZSRrNWFU9ls3s,7
|
57
|
+
gomyck_tools-1.2.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|