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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: knify
3
- Version: 1.8.42
3
+ Version: 1.8.44
4
4
  Summary: Development tools for python
5
5
  Home-page: https://github.com/qicongsheng/knify
6
6
  Author: qicongsheng
@@ -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()
@@ -2,12 +2,13 @@
2
2
  # -*- coding:utf-8 -*-
3
3
  # Author: qicongsheng
4
4
 
5
+
5
6
  def get_pip_name():
6
7
  return 'knify'
7
8
 
8
9
 
9
10
  def get_version():
10
- return '1.8.42'
11
+ return '1.8.44'
11
12
 
12
13
 
13
14
  def print_version():
@@ -2,5 +2,6 @@
2
2
  # -*- coding:utf-8 -*-
3
3
  # Author: qicongsheng
4
4
 
5
+
5
6
  def partition(list_obj, partition_size):
6
7
  return [list_obj[i:i + partition_size] for i in range(0, len(list_obj), partition_size)]
@@ -2,5 +2,6 @@
2
2
  # -*- coding:utf-8 -*-
3
3
  # Author: qicongsheng
4
4
 
5
+
5
6
  def default_if_none(obj: object, default_value: object) -> object:
6
7
  return default_value if obj is None or obj == '' else obj
@@ -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("===================== start =====================")
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("===================== end =====================")
46
+ logger.info("==================== end ====================")
47
47
  print_task()
48
48
  if index_ < len(list_partition) - 1:
49
- logger.info("===================== start =====================")
49
+ logger.info("==================== start ====================")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: knify
3
- Version: 1.8.42
3
+ Version: 1.8.44
4
4
  Summary: Development tools for python
5
5
  Home-page: https://github.com/qicongsheng/knify
6
6
  Author: qicongsheng
@@ -3,6 +3,7 @@ README.md
3
3
  setup.py
4
4
  knify/__init__.py
5
5
  knify/dateutil.py
6
+ knify/fileutil.py
6
7
  knify/help.py
7
8
  knify/listutil.py
8
9
  knify/logger.py
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes