ezKit 1.8.7__py3-none-any.whl → 1.8.8__py3-none-any.whl
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.
- ezKit/utils.py +48 -17
- {ezKit-1.8.7.dist-info → ezKit-1.8.8.dist-info}/METADATA +1 -1
- {ezKit-1.8.7.dist-info → ezKit-1.8.8.dist-info}/RECORD +6 -6
- {ezKit-1.8.7.dist-info → ezKit-1.8.8.dist-info}/LICENSE +0 -0
- {ezKit-1.8.7.dist-info → ezKit-1.8.8.dist-info}/WHEEL +0 -0
- {ezKit-1.8.7.dist-info → ezKit-1.8.8.dist-info}/top_level.txt +0 -0
ezKit/utils.py
CHANGED
@@ -496,35 +496,66 @@ def list_split(
|
|
496
496
|
|
497
497
|
def list_print_by_step(
|
498
498
|
data: list,
|
499
|
-
|
500
|
-
separator: str
|
501
|
-
debug: bool = False
|
499
|
+
step: int,
|
500
|
+
separator: str = " "
|
502
501
|
) -> bool:
|
503
502
|
"""
|
504
|
-
|
505
|
-
|
506
|
-
列表按照 步长 和 分隔符 有规律的输出
|
503
|
+
根据 步长 和 分隔符 有规律的打印列表中的数据
|
507
504
|
"""
|
508
505
|
try:
|
509
506
|
|
510
|
-
result: list = []
|
507
|
+
# result: list = []
|
511
508
|
|
512
|
-
if len(data) <=
|
513
|
-
|
514
|
-
else:
|
515
|
-
|
516
|
-
|
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")
|
517
532
|
return False
|
518
|
-
|
533
|
+
case _:
|
534
|
+
pass
|
519
535
|
|
520
|
-
|
521
|
-
|
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()
|
522
554
|
|
523
555
|
return True
|
524
556
|
|
525
557
|
except Exception as e:
|
526
|
-
|
527
|
-
logger.exception(e)
|
558
|
+
logger.exception(e)
|
528
559
|
return False
|
529
560
|
|
530
561
|
|
@@ -11,10 +11,10 @@ ezKit/redis.py,sha256=HVofsLdSBbBHAR-veumsrjTwZQspRDy2FXNR6MDCCXs,1972
|
|
11
11
|
ezKit/sendemail.py,sha256=Qxu4XQkHRPeX6FSJdzj-MXND9NyKcgHljbafNmy34H0,8243
|
12
12
|
ezKit/stock.py,sha256=p-l6Tv0oZdJ3juxkddScphm7BW4vH-mBozBgSH1Qu0w,1730
|
13
13
|
ezKit/token.py,sha256=9CAZhPdXiRiWoOIeWmP0q6L3j1zQAv4YcVWH95Tjefs,1755
|
14
|
-
ezKit/utils.py,sha256=
|
14
|
+
ezKit/utils.py,sha256=zbRnN9-uNO3D-XM_WnKG8MQJDLgM_cBgRyfKviO-gGQ,50120
|
15
15
|
ezKit/xftp.py,sha256=XyIdr_2rxRVLqPofG6fIYWhAMVsFwTyp46dg5P9FLW4,7774
|
16
|
-
ezKit-1.8.
|
17
|
-
ezKit-1.8.
|
18
|
-
ezKit-1.8.
|
19
|
-
ezKit-1.8.
|
20
|
-
ezKit-1.8.
|
16
|
+
ezKit-1.8.8.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
17
|
+
ezKit-1.8.8.dist-info/METADATA,sha256=PoIPrw9iouVSB3pZzEpnzyqm8jVsSuaO93prmzafZlE,190
|
18
|
+
ezKit-1.8.8.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
19
|
+
ezKit-1.8.8.dist-info/top_level.txt,sha256=aYLB_1WODsqNTsTFWcKP-BN0KCTKcV-HZJ4zlHkCFw8,6
|
20
|
+
ezKit-1.8.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|