knify 1.8.42__tar.gz → 1.8.44__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {knify-1.8.42 → knify-1.8.44}/PKG-INFO +1 -1
- knify-1.8.44/knify/fileutil.py +14 -0
- {knify-1.8.42 → knify-1.8.44}/knify/help.py +2 -1
- {knify-1.8.42 → knify-1.8.44}/knify/listutil.py +1 -0
- {knify-1.8.42 → knify-1.8.44}/knify/objutil.py +1 -0
- {knify-1.8.42 → knify-1.8.44}/knify/threadutil.py +3 -3
- {knify-1.8.42 → knify-1.8.44}/knify.egg-info/PKG-INFO +1 -1
- {knify-1.8.42 → knify-1.8.44}/knify.egg-info/SOURCES.txt +1 -0
- {knify-1.8.42 → knify-1.8.44}/LICENSE +0 -0
- {knify-1.8.42 → knify-1.8.44}/README.md +0 -0
- {knify-1.8.42 → knify-1.8.44}/knify/__init__.py +0 -0
- {knify-1.8.42 → knify-1.8.44}/knify/dateutil.py +0 -0
- {knify-1.8.42 → knify-1.8.44}/knify/logger.py +0 -0
- {knify-1.8.42 → knify-1.8.44}/knify/warnutil.py +0 -0
- {knify-1.8.42 → knify-1.8.44}/knify.egg-info/dependency_links.txt +0 -0
- {knify-1.8.42 → knify-1.8.44}/knify.egg-info/requires.txt +0 -0
- {knify-1.8.42 → knify-1.8.44}/knify.egg-info/top_level.txt +0 -0
- {knify-1.8.42 → knify-1.8.44}/setup.cfg +0 -0
- {knify-1.8.42 → knify-1.8.44}/setup.py +0 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding:utf-8 -*-
|
3
|
+
# Author: qicongsheng
|
4
|
+
|
5
|
+
|
6
|
+
def read_to_string(file_path_: str, encoding_: str = 'utf-8') -> str:
|
7
|
+
with open(file_path_, 'r', encoding=encoding_) as file:
|
8
|
+
content = file.read()
|
9
|
+
return content
|
10
|
+
|
11
|
+
|
12
|
+
def read_lines(file_path_: str, encoding_: str = 'utf-8') -> list[str]:
|
13
|
+
with open(file_path_, 'r', encoding=encoding_) as file:
|
14
|
+
return file.readlines()
|
@@ -32,7 +32,7 @@ def func_wrapper(list_objs_: list, _func_) -> None:
|
|
32
32
|
def thread_partition_call(list_obj: list, _func_, thread_num: int, partition_num: int) -> None:
|
33
33
|
list_partition = listutil.partition(list_obj, partition_num)
|
34
34
|
threads = []
|
35
|
-
logger.info("
|
35
|
+
logger.info("==================== start ====================")
|
36
36
|
task_info['total'] = len(list_obj)
|
37
37
|
task_info['time_start'] = dateutil.now()
|
38
38
|
for index_, list_for_process in enumerate(list_partition):
|
@@ -43,7 +43,7 @@ def thread_partition_call(list_obj: list, _func_, thread_num: int, partition_num
|
|
43
43
|
for t_ in threads:
|
44
44
|
t_.join()
|
45
45
|
threads = []
|
46
|
-
logger.info("
|
46
|
+
logger.info("==================== end ====================")
|
47
47
|
print_task()
|
48
48
|
if index_ < len(list_partition) - 1:
|
49
|
-
logger.info("
|
49
|
+
logger.info("==================== start ====================")
|
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
|