@@ -42,7 +42,14 @@ class Theme:
4242 extra_style : dict [_TokenType , str ]
4343 symbols : Symbols
4444
45- def __init__ (self , name : str , base : str | None , extra_style : dict [_TokenType , str ], * , symbols : Symbols | None = None ) -> None :
45+ def __init__ (
46+ self ,
47+ name : str ,
48+ base : str | None ,
49+ extra_style : dict [_TokenType , str ],
50+ * ,
51+ symbols : Symbols | None = None ,
52+ ) -> None :
4653 self .name = name
4754 self .base = base
4855 self .extra_style = extra_style
@@ -63,7 +70,6 @@ class MyStyle(Style):
6370 return MyStyle
6471
6572 def format (self , stream : TokenStream ) -> str :
66-
6773 return pygments .format (stream , self ._formatter )
6874
6975 def make_arrow (self , width : int ) -> str :
@@ -399,7 +405,7 @@ def __init__(self, out: Any = sys.stdout, *, theme_name: str | None = None) -> N
399405 self .out = out
400406 self .pos = 0
401407 self .lines = []
402- self .raw = ''
408+ self .raw = ""
403409 if theme_name is not None :
404410 if theme_name in ["Linux" , "LightBG" , "Neutral" , "NoColor" ]:
405411 warnings .warn (
@@ -525,7 +531,9 @@ def format2(self, raw: str, out: Any = None) -> tuple[str | None, bool]:
525531 return (output , error )
526532 return (None , error )
527533
528- def _inner_call_ (self , toktype : int , toktext : str , start_pos : tuple [int , int ]) -> str :
534+ def _inner_call_ (
535+ self , toktype : int , toktext : str , start_pos : tuple [int , int ]
536+ ) -> str :
529537 """like call but write to a temporary buffer"""
530538 srow , scol = start_pos
531539
@@ -557,6 +565,13 @@ def _inner_call_(self, toktype: int, toktext: str, start_pos: tuple[int, int]) -
557565 acc += theme_table [self .theme_name ].format ([(pyg_tok_type , toktext )])
558566 return acc
559567
560- def __call__ (self , toktype : int , toktext : str , start_pos : tuple [int , int ], end_pos : tuple [int , int ], line : str ) -> None :
568+ def __call__ (
569+ self ,
570+ toktype : int ,
571+ toktext : str ,
572+ start_pos : tuple [int , int ],
573+ end_pos : tuple [int , int ],
574+ line : str ,
575+ ) -> None :
561576 """Token handler, with syntax highlighting."""
562577 self .out .write (self ._inner_call_ (toktype , toktext , start_pos ))
0 commit comments