File tree 2 files changed +10
-8
lines changed
2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ dynamic = [ "version" ]
37
37
dependencies = [
38
38
" httpx>=0.19" ,
39
39
" platformdirs" ,
40
- " prettytable>=2.4 " ,
40
+ " prettytable>=3.12 " ,
41
41
" pytablewriter[html]>=0.63" ,
42
42
" python-dateutil" ,
43
43
" python-slugify" ,
Original file line number Diff line number Diff line change @@ -227,29 +227,31 @@ def _prettytable(
227
227
color : str = "yes" ,
228
228
title : str | None = None ,
229
229
) -> str :
230
- from prettytable import MARKDOWN , SINGLE_BORDER , PrettyTable
230
+ from prettytable import PrettyTable , TableStyle
231
231
232
- x = PrettyTable ()
233
- x .set_style (MARKDOWN if format_ == "markdown" else SINGLE_BORDER )
232
+ table = PrettyTable ()
233
+ table .set_style (
234
+ TableStyle .MARKDOWN if format_ == "markdown" else TableStyle .SINGLE_BORDER
235
+ )
234
236
do_color = color != "no" and format_ == "pretty"
235
237
236
238
for header in headers :
237
239
left_align = header in ("cycle" , "latest" , "link" )
238
240
display_header = colored (header , attrs = ["bold" ]) if do_color else header
239
241
col_data = [row [header ] if header in row else "" for row in data ]
240
- x .add_column (display_header , col_data )
242
+ table .add_column (display_header , col_data )
241
243
242
244
if left_align :
243
- x .align [display_header ] = "l"
245
+ table .align [display_header ] = "l"
244
246
245
247
title_prefix = ""
246
248
if title :
247
249
if format_ == "pretty" :
248
- x .title = colored (title , attrs = ["bold" ]) if do_color else title
250
+ table .title = colored (title , attrs = ["bold" ]) if do_color else title
249
251
else :
250
252
title_prefix = f"## { title } \n \n "
251
253
252
- return title_prefix + x .get_string ()
254
+ return title_prefix + table .get_string ()
253
255
254
256
255
257
def _pytablewriter (
You can’t perform that action at this time.
0 commit comments