knify 1.8.40__tar.gz → 1.8.42__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {knify-1.8.40 → knify-1.8.42}/PKG-INFO +1 -1
- {knify-1.8.40 → knify-1.8.42}/knify/help.py +1 -1
- {knify-1.8.40 → knify-1.8.42}/knify/threadutil.py +7 -7
- {knify-1.8.40 → knify-1.8.42}/knify.egg-info/PKG-INFO +1 -1
- {knify-1.8.40 → knify-1.8.42}/LICENSE +0 -0
- {knify-1.8.40 → knify-1.8.42}/README.md +0 -0
- {knify-1.8.40 → knify-1.8.42}/knify/__init__.py +0 -0
- {knify-1.8.40 → knify-1.8.42}/knify/dateutil.py +0 -0
- {knify-1.8.40 → knify-1.8.42}/knify/listutil.py +0 -0
- {knify-1.8.40 → knify-1.8.42}/knify/logger.py +0 -0
- {knify-1.8.40 → knify-1.8.42}/knify/objutil.py +0 -0
- {knify-1.8.40 → knify-1.8.42}/knify/warnutil.py +0 -0
- {knify-1.8.40 → knify-1.8.42}/knify.egg-info/SOURCES.txt +0 -0
- {knify-1.8.40 → knify-1.8.42}/knify.egg-info/dependency_links.txt +0 -0
- {knify-1.8.40 → knify-1.8.42}/knify.egg-info/requires.txt +0 -0
- {knify-1.8.40 → knify-1.8.42}/knify.egg-info/top_level.txt +0 -0
- {knify-1.8.40 → knify-1.8.42}/setup.cfg +0 -0
- {knify-1.8.40 → knify-1.8.42}/setup.py +0 -0
@@ -22,28 +22,28 @@ def print_task():
|
|
22
22
|
dateutil.date_to_str(time_estimate, dateutil.FORMAT_HMS)))
|
23
23
|
|
24
24
|
|
25
|
-
def func_wrapper(list_objs_: list,
|
26
|
-
|
25
|
+
def func_wrapper(list_objs_: list, _func_) -> None:
|
26
|
+
_func_(list_objs_)
|
27
27
|
task_lock.acquire()
|
28
28
|
task_info['processed'] = task_info['processed'] + len(list_objs_)
|
29
29
|
task_lock.release()
|
30
30
|
|
31
31
|
|
32
|
-
def thread_partition_call(list_obj: list,
|
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):
|
39
|
-
t = threading.Thread(target=func_wrapper, args=(list_for_process,
|
39
|
+
t = threading.Thread(target=func_wrapper, args=(list_for_process, _func_))
|
40
40
|
t.start()
|
41
41
|
threads.append(t)
|
42
42
|
if len(threads) == thread_num or index_ == len(list_partition) - 1:
|
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
|
File without changes
|
File without changes
|
File without changes
|