@@ -108,7 +108,7 @@ def append_category(category: OptionCategory[Any]) -> None:
108108 tokens .extend (
109109 [
110110 ("class:sidebar" , " " ),
111- ("class:sidebar.title" , " %-36s" % category .title ),
111+ ("class:sidebar.title" , f " { category .title :36 } " ),
112112 ("class:sidebar" , "\n " ),
113113 ]
114114 )
@@ -130,7 +130,7 @@ def goto_next(mouse_event: MouseEvent) -> None:
130130 sel = ",selected" if selected else ""
131131
132132 tokens .append (("class:sidebar" + sel , " >" if selected else " " ))
133- tokens .append (("class:sidebar.label" + sel , "%-24s" % label , select_item ))
133+ tokens .append (("class:sidebar.label" + sel , f" { label :24 } " , select_item ))
134134 tokens .append (("class:sidebar.status" + sel , " " , select_item ))
135135 tokens .append (("class:sidebar.status" + sel , f"{ status } " , goto_next ))
136136
@@ -332,7 +332,7 @@ def get_continuation(
332332 width : int , line_number : int , is_soft_wrap : bool
333333 ) -> StyleAndTextTuples :
334334 if python_input .show_line_numbers and not is_soft_wrap :
335- text = ( "%i " % ( line_number + 1 )) .rjust (width )
335+ text = f" { line_number + 1 } " .rjust (width )
336336 return [("class:line-number" , text )]
337337 else :
338338 return to_formatted_text (get_prompt_style ().in2_prompt (width ))
@@ -368,8 +368,7 @@ def get_text_fragments() -> StyleAndTextTuples:
368368 append (
369369 (
370370 TB ,
371- "%i/%i "
372- % (python_buffer .working_index + 1 , len (python_buffer ._working_lines )),
371+ f"{ python_buffer .working_index + 1 } /{ len (python_buffer ._working_lines )} " ,
373372 )
374373 )
375374
@@ -492,8 +491,7 @@ def toggle_sidebar(mouse_event: MouseEvent) -> None:
492491 ("class:status-toolbar" , " - " ),
493492 (
494493 "class:status-toolbar.python-version" ,
495- "%s %i.%i.%i"
496- % (platform .python_implementation (), version [0 ], version [1 ], version [2 ]),
494+ f"{ platform .python_implementation ()} { version [0 ]} .{ version [1 ]} .{ version [2 ]} " ,
497495 ),
498496 ("class:status-toolbar" , " " ),
499497 ]
0 commit comments