knify 1.8.39__tar.gz → 1.8.41__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: knify
3
- Version: 1.8.39
3
+ Version: 1.8.41
4
4
  Summary: Development tools for python
5
5
  Home-page: https://github.com/qicongsheng/knify
6
6
  Author: qicongsheng
@@ -7,7 +7,7 @@ def get_pip_name():
7
7
 
8
8
 
9
9
  def get_version():
10
- return '1.8.39'
10
+ return '1.8.41'
11
11
 
12
12
 
13
13
  def print_version():
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding:utf-8 -*-
3
+ # Author: qicongsheng
4
+
5
+ def default_if_none(obj: object, default_value: object) -> object:
6
+ return default_value if obj is None or obj == '' else obj
@@ -22,21 +22,21 @@ 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, func_) -> None:
26
- func_(list_objs_)
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, func_, thread_num: int, partition_num: int) -> None:
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
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, func_))
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:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: knify
3
- Version: 1.8.39
3
+ Version: 1.8.41
4
4
  Summary: Development tools for python
5
5
  Home-page: https://github.com/qicongsheng/knify
6
6
  Author: qicongsheng
@@ -6,6 +6,7 @@ knify/dateutil.py
6
6
  knify/help.py
7
7
  knify/listutil.py
8
8
  knify/logger.py
9
+ knify/objutil.py
9
10
  knify/threadutil.py
10
11
  knify/warnutil.py
11
12
  knify.egg-info/PKG-INFO
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