ygo 1.1.0__py3-none-any.whl → 1.1.1__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 ygo might be problematic. Click here for more details.
- ygo/__init__.py +1 -1
- {ygo-1.1.0.dist-info → ygo-1.1.1.dist-info}/METADATA +3 -2
- ygo-1.1.1.dist-info/RECORD +12 -0
- ylog/core.py +3 -5
- ygo-1.1.0.dist-info/RECORD +0 -12
- {ygo-1.1.0.dist-info → ygo-1.1.1.dist-info}/WHEEL +0 -0
- {ygo-1.1.0.dist-info → ygo-1.1.1.dist-info}/licenses/LICENSE +0 -0
- {ygo-1.1.0.dist-info → ygo-1.1.1.dist-info}/top_level.txt +0 -0
ygo/__init__.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ygo
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.1
|
|
4
|
+
Summary: 一个轻量级 Python 工具包,支持 并发执行(带进度条)、延迟调用、链式绑定参数、函数信息获取、模块/函数动态加载。并结合 ylog 提供日志记录能力
|
|
4
5
|
Project-URL: homepage, https://github.com/link-yundi/ygo
|
|
5
6
|
Project-URL: repository, https://github.com/link-yundi/ygo
|
|
6
7
|
Requires-Python: >=3.12
|
|
@@ -54,7 +55,7 @@ import ygo
|
|
|
54
55
|
import ylog
|
|
55
56
|
from a.b.c import test_fn
|
|
56
57
|
|
|
57
|
-
with ygo.pool(
|
|
58
|
+
with ygo.pool(n_jobs=5, show_progress=True) as go:
|
|
58
59
|
for i in range(10):
|
|
59
60
|
go.submit(test_fn)(a=i, b=2*i)
|
|
60
61
|
for res in go.do():
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
ygo/__init__.py,sha256=R2f-N5iXfAFqyCTkTgTjyh0WImaCfrhOFeQcYq2Fm4E,679
|
|
2
|
+
ygo/delay.py,sha256=66xtPXqyD630FL7LWL5qJKAIZvyGDwZyM4qPfk8Czlg,2206
|
|
3
|
+
ygo/exceptions.py,sha256=0OYDYt_9KKo8mF2XBG5QkCMr3-ASp69VDSPOEwlIsrI,660
|
|
4
|
+
ygo/pool.py,sha256=bnHm4TtnRoFBv5UvV7WpuObJoK4FdoRf65mvf82yEyI,7052
|
|
5
|
+
ygo/utils.py,sha256=c-g4fJgeZp8diinkJhX4DAJBZEhH2tHYniUzRlt1EgU,3178
|
|
6
|
+
ygo-1.1.1.dist-info/licenses/LICENSE,sha256=6AKUWQ1xe-jwPSFv_H6FMQLNNWb7AYqzuEUTwlP2S8M,1067
|
|
7
|
+
ylog/__init__.py,sha256=aNrUp1n3JJFMUt1JFEsq33bckIhSQwCiTQCmV9rOMYk,452
|
|
8
|
+
ylog/core.py,sha256=b8Qfk2W-n9WWHWPwx0-q6PJaavUQ6ezcl1EIPN_a-2A,9199
|
|
9
|
+
ygo-1.1.1.dist-info/METADATA,sha256=teLZGb5FH-hm6j-SaWggvIH-uXsgRuAUtd9CHpYez5E,4844
|
|
10
|
+
ygo-1.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
+
ygo-1.1.1.dist-info/top_level.txt,sha256=sY7lJBJ2ncfEMAxoNBVay0RVUixpVt9Osuwwy0_uWqU,9
|
|
12
|
+
ygo-1.1.1.dist-info/RECORD,,
|
ylog/core.py
CHANGED
|
@@ -9,7 +9,6 @@ Created on 2025/5/14 16:04
|
|
|
9
9
|
|
|
10
10
|
import sys
|
|
11
11
|
from pathlib import Path
|
|
12
|
-
from threading import Lock
|
|
13
12
|
from typing import Optional
|
|
14
13
|
|
|
15
14
|
from loguru import logger
|
|
@@ -34,7 +33,7 @@ class _Logger:
|
|
|
34
33
|
def __init__(
|
|
35
34
|
self,
|
|
36
35
|
log_dir: str = "logs",
|
|
37
|
-
app_name: str|None = None,
|
|
36
|
+
app_name: str | None = None,
|
|
38
37
|
retention_days: int = 7,
|
|
39
38
|
error_retention_days: int = 30,
|
|
40
39
|
enable_console: bool = True,
|
|
@@ -145,8 +144,6 @@ class _Logger:
|
|
|
145
144
|
catch=True # 捕获格式化异常
|
|
146
145
|
)
|
|
147
146
|
|
|
148
|
-
|
|
149
|
-
|
|
150
147
|
def _setup_global_exception_handling(self):
|
|
151
148
|
"""配置全局异常捕获"""
|
|
152
149
|
|
|
@@ -230,6 +227,7 @@ class _Logger:
|
|
|
230
227
|
if enable_file is not False:
|
|
231
228
|
self._setup_file_logging(self._retention_days, self._error_retention_days)
|
|
232
229
|
|
|
230
|
+
|
|
233
231
|
# 初始化默认实例
|
|
234
232
|
_default_logger = _Logger()
|
|
235
233
|
|
|
@@ -242,6 +240,7 @@ error = _default_logger.error
|
|
|
242
240
|
critical = _default_logger.critical
|
|
243
241
|
update_config = _default_logger.update_config
|
|
244
242
|
|
|
243
|
+
|
|
245
244
|
def get_logger(app_name: str,
|
|
246
245
|
log_dir: str = "logs",
|
|
247
246
|
retention_days: int = 7,
|
|
@@ -259,4 +258,3 @@ def get_logger(app_name: str,
|
|
|
259
258
|
enable_file=enable_file,
|
|
260
259
|
debug_mode=debug_mode
|
|
261
260
|
)
|
|
262
|
-
|
ygo-1.1.0.dist-info/RECORD
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
ygo/__init__.py,sha256=AlvzcS4Ge94nklq5AhPhCNCIg5D1F8gaZqhdzQpoXH4,679
|
|
2
|
-
ygo/delay.py,sha256=66xtPXqyD630FL7LWL5qJKAIZvyGDwZyM4qPfk8Czlg,2206
|
|
3
|
-
ygo/exceptions.py,sha256=0OYDYt_9KKo8mF2XBG5QkCMr3-ASp69VDSPOEwlIsrI,660
|
|
4
|
-
ygo/pool.py,sha256=bnHm4TtnRoFBv5UvV7WpuObJoK4FdoRf65mvf82yEyI,7052
|
|
5
|
-
ygo/utils.py,sha256=c-g4fJgeZp8diinkJhX4DAJBZEhH2tHYniUzRlt1EgU,3178
|
|
6
|
-
ygo-1.1.0.dist-info/licenses/LICENSE,sha256=6AKUWQ1xe-jwPSFv_H6FMQLNNWb7AYqzuEUTwlP2S8M,1067
|
|
7
|
-
ylog/__init__.py,sha256=aNrUp1n3JJFMUt1JFEsq33bckIhSQwCiTQCmV9rOMYk,452
|
|
8
|
-
ylog/core.py,sha256=d6QCFRDTvlyxgvS6JphUGOgX5Mgx9qPv9wB3g-4YOJw,9225
|
|
9
|
-
ygo-1.1.0.dist-info/METADATA,sha256=Eelk_nhMZZ6nwqCtTtmLJabPuLB3d0PacwbS3rP8uDE,4651
|
|
10
|
-
ygo-1.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
-
ygo-1.1.0.dist-info/top_level.txt,sha256=sY7lJBJ2ncfEMAxoNBVay0RVUixpVt9Osuwwy0_uWqU,9
|
|
12
|
-
ygo-1.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|