File tree Expand file tree Collapse file tree 5 files changed +24
-7
lines changed
Expand file tree Collapse file tree 5 files changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -2762,7 +2762,7 @@ def _main():
27622762 print (usage )
27632763 sys .exit (0 )
27642764 files = [sys .stdin ] if not args else args
2765- with ( sys .stdout if outfile == "-" else open (outfile , "w" ) ) as out :
2765+ with sys .stdout if outfile == "-" else open (outfile , "w" ) as out :
27662766 for f in files :
27672767 if f == "-" :
27682768 f = sys .stdin
Original file line number Diff line number Diff line change 22
33"""
44
5-
65import os
76import sys
87
Original file line number Diff line number Diff line change @@ -180,9 +180,16 @@ def test_wrap_text_wide_chars():
180180 except ImportError :
181181 skip ("test_wrap_text_wide_chars is skipped" )
182182
183- rows = [["청자청자청자청자청자" , "약간 감싸면 더 잘 보일 수있는 다소 긴 설명입니다" ]]
183+ rows = [
184+ ["청자청자청자청자청자" , "약간 감싸면 더 잘 보일 수있는 다소 긴 설명입니다" ]
185+ ]
184186 widths = [5 , 20 ]
185- expected = [["청자\n 청자\n 청자\n 청자\n 청자" , "약간 감싸면 더 잘\n 보일 수있는 다소 긴\n 설명입니다" ]]
187+ expected = [
188+ [
189+ "청자\n 청자\n 청자\n 청자\n 청자" ,
190+ "약간 감싸면 더 잘\n 보일 수있는 다소 긴\n 설명입니다" ,
191+ ]
192+ ]
186193 result = T ._wrap_text_to_colwidths (rows , widths )
187194
188195 assert_equal (expected , result )
@@ -239,7 +246,14 @@ def test_wrap_text_to_colwidths_colors_wide_char():
239246 except ImportError :
240247 skip ("test_wrap_text_to_colwidths_colors_wide_char is skipped" )
241248
242- data = [[("\033 [31m약간 감싸면 더 잘 보일 수있는 다소 긴" " 설명입니다 설명입니다 설명입니다 설명입니다 설명\033 [0m" )]]
249+ data = [
250+ [
251+ (
252+ "\033 [31m약간 감싸면 더 잘 보일 수있는 다소 긴"
253+ " 설명입니다 설명입니다 설명입니다 설명입니다 설명\033 [0m"
254+ )
255+ ]
256+ ]
243257 result = T ._wrap_text_to_colwidths (data , [30 ])
244258
245259 expected = [
Original file line number Diff line number Diff line change @@ -136,7 +136,10 @@ def test_plain_maxcolwidth_autowraps_wide_chars():
136136
137137 table = [
138138 ["hdr" , "fold" ],
139- ["1" , "약간 감싸면 더 잘 보일 수있는 다소 긴 설명입니다 설명입니다 설명입니다 설명입니다 설명" ],
139+ [
140+ "1" ,
141+ "약간 감싸면 더 잘 보일 수있는 다소 긴 설명입니다 설명입니다 설명입니다 설명입니다 설명" ,
142+ ],
140143 ]
141144 expected = "\n " .join (
142145 [
Original file line number Diff line number Diff line change @@ -143,7 +143,8 @@ def test_wrap_color_in_single_line():
143143
144144def test_wrap_color_line_splillover ():
145145 """TextWrapper: Wrap a line - preserve internal color tags and wrap them to
146- other lines when required, requires adding the colors tags to other lines as appropriate"""
146+ other lines when required, requires adding the colors tags to other lines as appropriate
147+ """
147148 # This has both a text color and a background color
148149 data = "This is a \033 [31mtest string for testing TextWrap\033 [0m with colors"
149150
You can’t perform that action at this time.
0 commit comments