Skip to content

Commit be9f1e3

Browse files
committed
1.cpshoww 显示详细的转义序列信息
1 parent f2a7655 commit be9f1e3

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ print("@56056{0}@45031[ World!]".cformat("Hello "))
4343

4444
## 其他命令行
4545

46+
* `cpshoww` : 显示各个 id 的详细信息
4647
* `cpdemo` : Hello World! 样例
4748
* `cpdemoid` : Hello World! 样例并显示样式ID
4849

@@ -95,6 +96,7 @@ TIME: 10:23:35
9596
* 20230223: 1.更新文档 2.增加 `cpdemoid` 命令行.
9697
* 20230303: 1.更新 `iformat` 函数.
9798
* 20230315: 1.更新 `[]` 功能.
99+
* 20241129: 1.`cpshoww` 显示详细的转义序列信息
98100

99101
[1]: https://raw.githubusercontent.com/EVA-JianJun/cprint/master/img/1.png
100102
[2]: https://raw.githubusercontent.com/EVA-JianJun/cprint/master/img/2.png

cprint/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from cprint.tools import demoid as _demoid
55
from cprint.tools import getshow_config as _showconfig
66

7-
__version__ = "1.6.0"
7+
__version__ = "1.7.0"
88

99
cprint.custom_style = {}
1010

cprint/tools.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def getshow_config(mode: int=1) -> dict or None:
2525
use_print_2 = print
2626
else:
2727
use_print_1 = print
28-
use_print_2 = print
28+
use_print_2 = lambda *args, **kwargs : None
2929

3030
id_plus = 0
3131
# 32样式字典
@@ -34,7 +34,7 @@ def getshow_config(mode: int=1) -> dict or None:
3434
""" 打印所有颜色详细信息 """
3535
# 打印默认样式
3636
for style in COLOR32.STYLE:
37-
use_print_1('ID {6:>4} style {0} text_color {1} background_color {2}: \033[{3};{4};{5}m CHERRY \033[0;0m'.format(
37+
use_print_1('ID {6:>4} style {0} text_color {1} background_color {2}: \\033[{3};{4};{5}m \033[{3};{4};{5}m CHERRY \033[0;0m \\033[0;0m'.format(
3838
COLOR32.STYLE[style], COLOR32.TEXT_COLOR["01"], COLOR32.BACKGROUND_COLOR["01"],
3939
style, "01", "01",
4040
id_plus,
@@ -49,7 +49,7 @@ def getshow_config(mode: int=1) -> dict or None:
4949
background_color = background_color_list[1:9][index]
5050
for text_color in COLOR32.TEXT_COLOR:
5151
for style in COLOR32.STYLE:
52-
use_print_1('ID {6:>4} style {0} text_color {1} background_color {2}: \033[{3};{4};{5}m CHERRY \033[0;0m'.format(
52+
use_print_1('ID {6:>4} style {0} text_color {1} background_color {2}: \\033[{3};{4};{5}m \033[{3};{4};{5}m CHERRY \033[0;0m \\033[0;0m'.format(
5353
COLOR32.STYLE[style], COLOR32.TEXT_COLOR[text_color], COLOR32.BACKGROUND_COLOR[background_color],
5454
style, text_color, background_color,
5555
id_plus,
@@ -60,7 +60,7 @@ def getshow_config(mode: int=1) -> dict or None:
6060
background_color = background_color_list[9:][index]
6161
for text_color in COLOR32.TEXT_COLOR:
6262
for style in COLOR32.STYLE:
63-
use_print_1('ID {6:>4} style {0} text_color {1} background_color {2}: \033[{3};{4};{5}m CHERRY \033[0;0m'.format(
63+
use_print_1('ID {6:>4} style {0} text_color {1} background_color {2}: \\033[{3};{4};{5}m \033[{3};{4};{5}m CHERRY \033[0;0m \\033[0;0m'.format(
6464
COLOR32.STYLE[style], COLOR32.TEXT_COLOR[text_color], COLOR32.BACKGROUND_COLOR[background_color],
6565
style, text_color, background_color,
6666
id_plus,
@@ -71,7 +71,7 @@ def getshow_config(mode: int=1) -> dict or None:
7171
text_color = text_color_list[1:9][index]
7272
for text_color in COLOR32.TEXT_COLOR:
7373
for style in COLOR32.STYLE:
74-
use_print_1('ID {6:>4} style {0} text_color {1} background_color {2}: \033[{3};{4};{5}m CHERRY \033[0;0m'.format(
74+
use_print_1('ID {6:>4} style {0} text_color {1} background_color {2}: \\033[{3};{4};{5}m \033[{3};{4};{5}m CHERRY \033[0;0m \\033[0;0m'.format(
7575
COLOR32.STYLE[style], COLOR32.TEXT_COLOR[text_color], COLOR32.BACKGROUND_COLOR[background_color],
7676
style, text_color, background_color,
7777
id_plus,
@@ -82,7 +82,7 @@ def getshow_config(mode: int=1) -> dict or None:
8282
text_color = text_color_list[9:][index]
8383
for text_color in COLOR32.TEXT_COLOR:
8484
for style in COLOR32.STYLE:
85-
use_print_1('ID {6:>4} style {0} text_color {1} background_color {2}: \033[{3};{4};{5}m CHERRY \033[0;0m'.format(
85+
use_print_1('ID {6:>4} style {0} text_color {1} background_color {2}: \\033[{3};{4};{5}m \033[{3};{4};{5}m CHERRY \033[0;0m \\033[0;0m'.format(
8686
COLOR32.STYLE[style], COLOR32.TEXT_COLOR[text_color], COLOR32.BACKGROUND_COLOR[background_color],
8787
style, text_color, background_color,
8888
id_plus,
@@ -93,15 +93,15 @@ def getshow_config(mode: int=1) -> dict or None:
9393
# 按颜色分类打印样式 256
9494
for fgbg in COLOR256.FGBG:
9595
for color_code in COLOR256.COLOR_CODE:
96-
use_print_1('ID {0:>4} FGBG {1} Color Code {2:>3}: \033[{1};5;{2}m CHERRY \033[0;0m'.format(
96+
use_print_1('ID {0:>4} FGBG {1} Color Code {2:>3}: \\033[{1};5;{2}m \033[{1};5;{2}m CHERRY \033[0;0m \\033[0;0m'.format(
9797
id_plus, fgbg, color_code,
9898
))
9999
STYLE_ID_DICT[id_plus] = "\033[{0};5;{1}m".format(fgbg, color_code)
100100
id_plus += 1
101101

102102
for color_code_48 in COLOR256.COLOR_CODE:
103103
for color_code_38 in COLOR256.COLOR_CODE:
104-
# use_print_1("\033[48;5;{0}m\033[38;5;{1}m CHERRY \033[0;0m".format(color_code_48, color_code_38))
104+
# use_print_1("\033[48;5;{0}m\033[38;5;{1}m CHERRY \033[0;0m \\033[0;0m".format(color_code_48, color_code_38))
105105
STYLE_ID_DICT[id_plus] = "\033[48;5;{0}m\033[38;5;{1}m".format(color_code_48, color_code_38)
106106
id_plus += 1
107107

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name = 'cprint-jianjun',
10-
version = '1.6.0',
10+
version = '1.7.0',
1111
author = 'jianjun',
1212
author_email = '[email protected]',
1313
url = 'https://github.com/EVA-JianJun/cprint',

0 commit comments

Comments
 (0)