ezKit 3.0.5__tar.gz → 3.0.7__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.
- {ezkit-3.0.5/ezKit.egg-info → ezkit-3.0.7}/PKG-INFO +1 -1
- {ezkit-3.0.5 → ezkit-3.0.7}/ezKit/utils.py +40 -0
- {ezkit-3.0.5 → ezkit-3.0.7/ezKit.egg-info}/PKG-INFO +1 -1
- {ezkit-3.0.5 → ezkit-3.0.7}/setup.py +1 -1
- {ezkit-3.0.5 → ezkit-3.0.7}/LICENSE +0 -0
- {ezkit-3.0.5 → ezkit-3.0.7}/MANIFEST.in +0 -0
- {ezkit-3.0.5 → ezkit-3.0.7}/README.md +0 -0
- {ezkit-3.0.5 → ezkit-3.0.7}/ezKit/__init__.py +0 -0
- {ezkit-3.0.5 → ezkit-3.0.7}/ezKit/database.py +0 -0
- {ezkit-3.0.5 → ezkit-3.0.7}/ezKit/sendemail.py +0 -0
- {ezkit-3.0.5 → ezkit-3.0.7}/ezKit.egg-info/SOURCES.txt +0 -0
- {ezkit-3.0.5 → ezkit-3.0.7}/ezKit.egg-info/dependency_links.txt +0 -0
- {ezkit-3.0.5 → ezkit-3.0.7}/ezKit.egg-info/requires.txt +0 -0
- {ezkit-3.0.5 → ezkit-3.0.7}/ezKit.egg-info/top_level.txt +0 -0
- {ezkit-3.0.5 → ezkit-3.0.7}/pyproject.toml +0 -0
- {ezkit-3.0.5 → ezkit-3.0.7}/setup.cfg +0 -0
|
@@ -244,3 +244,43 @@ def parent_dir(path: str, **kwargs) -> str | None:
|
|
|
244
244
|
logger.error(e)
|
|
245
245
|
|
|
246
246
|
return None
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
# --------------------------------------------------------------------------------------------------
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
def read_small_file(file_path) -> list[str] | None:
|
|
253
|
+
"""读取小文件"""
|
|
254
|
+
|
|
255
|
+
try:
|
|
256
|
+
|
|
257
|
+
with open(file_path, "r", encoding="utf-8") as _file:
|
|
258
|
+
return [clean_line for line in _file if (clean_line := line.strip())]
|
|
259
|
+
|
|
260
|
+
except Exception as e:
|
|
261
|
+
|
|
262
|
+
if DEBUG:
|
|
263
|
+
logger.exception(e)
|
|
264
|
+
else:
|
|
265
|
+
logger.error(e)
|
|
266
|
+
|
|
267
|
+
return None
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
def read_large_file(file_path):
|
|
271
|
+
"""读取大文件"""
|
|
272
|
+
|
|
273
|
+
try:
|
|
274
|
+
|
|
275
|
+
with open(file_path, "r", encoding="utf-8") as _file:
|
|
276
|
+
for line in _file:
|
|
277
|
+
clean_line = line.strip()
|
|
278
|
+
if clean_line:
|
|
279
|
+
yield clean_line
|
|
280
|
+
|
|
281
|
+
except Exception as e:
|
|
282
|
+
|
|
283
|
+
if DEBUG:
|
|
284
|
+
logger.exception(e)
|
|
285
|
+
else:
|
|
286
|
+
logger.error(e)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|