ezKit 1.8.6__tar.gz → 1.8.8__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ezKit
3
- Version: 1.8.6
3
+ Version: 1.8.8
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -496,30 +496,66 @@ def list_split(
496
496
 
497
497
  def list_print_by_step(
498
498
  data: list,
499
- number: int,
500
- separator: str | None = None,
501
- debug: bool = False
499
+ step: int,
500
+ separator: str = " "
502
501
  ) -> bool:
503
502
  """
504
- list print by step
505
-
506
- 列表按照 步长 和 分隔符 有规律的输出
503
+ 根据 步长 分隔符 有规律的打印列表中的数据
507
504
  """
508
505
  try:
509
506
 
510
- _data_list = list_split(data, number, debug=debug)
507
+ # result: list = []
511
508
 
512
- if _data_list is None:
513
- return False
509
+ # if len(data) <= step:
510
+ # result.append(data)
511
+ # else:
512
+ # data_list = list_split(data, step, debug=debug)
513
+ # if data_list is None or v_true(data_list, list) is False:
514
+ # return False
515
+ # result = data_list
516
+
517
+ # for item in result:
518
+ # print(*item, sep=separator)
519
+
520
+ # return True
521
+
522
+ # 判断参数类型
523
+ match True:
524
+ case True if isinstance(data, list) is False:
525
+ logger.error("argument type error: data")
526
+ return False
527
+ case True if isinstance(step, int) is False:
528
+ logger.error("argument type error: step")
529
+ return False
530
+ case True if isinstance(separator, str) is False:
531
+ logger.error("argument type error: separator")
532
+ return False
533
+ case _:
534
+ pass
514
535
 
515
- for _item in _data_list:
516
- print(*_item, sep=separator)
536
+ # 判断参数数据
537
+ match True:
538
+ case True if v_true(data, list) is False:
539
+ logger.error("argument error: data")
540
+ return False
541
+ case True if v_true(step, int) is False:
542
+ logger.error("argument error: step")
543
+ return False
544
+ case _:
545
+ pass
546
+
547
+ # 打印
548
+ for i, v in enumerate(data):
549
+ if i > 0 and i % step == 0:
550
+ print()
551
+ print(v, end=separator)
552
+
553
+ print()
517
554
 
518
555
  return True
519
556
 
520
557
  except Exception as e:
521
- if v_true(debug, bool):
522
- logger.exception(e)
558
+ logger.exception(e)
523
559
  return False
524
560
 
525
561
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ezKit
3
- Version: 1.8.6
3
+ Version: 1.8.8
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -3,7 +3,7 @@ from setuptools import find_packages, setup
3
3
 
4
4
  setup(
5
5
  name='ezKit',
6
- version='1.8.6',
6
+ version='1.8.8',
7
7
  author='septvean',
8
8
  author_email='septvean@gmail.com',
9
9
  description='Easy Kit',
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes