@@ -35,22 +35,22 @@ class TuiSession:
3535 """
3636
3737 def __init__ (
38- self ,
39- runners : list [tuple [str , str , DialectRunner ]],
40- dialect : Dialect ,
41- console : Console ,
42- prompt : Callable [[str ], str ],
43- ) -> None :
38+ self ,
39+ runners : list [tuple [str , str , DialectRunner ]],
40+ dialect : Dialect ,
41+ console : Console ,
42+ prompt : Callable [[str ], str ],
43+ ) -> None :
4444 self ._runners = runners
4545 self ._dialect = dialect
4646 self ._console = console
4747 self ._prompt = prompt
4848 self ._seq = 0
4949
5050 async def run_once (
51- self ,
52- schema : Any ,
53- instance : Any ,
51+ self ,
52+ schema : Any ,
53+ instance : Any ,
5454 ) -> list [tuple [str , str , bool | None ]]:
5555 """
5656 Validate one instance against one schema across all runners.
@@ -63,10 +63,7 @@ async def run_once(
6363 )
6464 seq_case = SeqCase (seq = self ._seq , case = case )
6565
66- tasks = [
67- seq_case .run (runner = runner )
68- for _ , _ , runner in self ._runners
69- ]
66+ tasks = [seq_case .run (runner = runner ) for _ , _ , runner in self ._runners ]
7067
7168 raw_results = await asyncio .gather (* tasks )
7269
@@ -80,8 +77,8 @@ async def run_once(
8077 return output
8178
8279 def show_results (
83- self ,
84- results : list [tuple [str , str , bool | None ]],
80+ self ,
81+ results : list [tuple [str , str , bool | None ]],
8582 ) -> None :
8683 table = Table (show_header = True , header_style = "bold" )
8784 table .add_column ("Implementation" )
@@ -107,13 +104,15 @@ async def repl(self) -> None:
107104 impl_count = len (self ._runners )
108105 impl_word = "implementation" if impl_count == 1 else "implementations"
109106
110- self ._console .print (Panel (
111- f"Dialect: [bold]{ self ._dialect .pretty_name } [/bold] "
112- f"Running: [bold]{ impl_count } [/bold] { impl_word } \n \n "
113- "[dim]Enter a JSON schema, then one instance to validate.\n "
114- "Type [bold]q[/bold] to quit.[/dim]" ,
115- title = "bowtie tui" ,
116- ))
107+ self ._console .print (
108+ Panel (
109+ f"Dialect: [bold]{ self ._dialect .pretty_name } [/bold] "
110+ f"Running: [bold]{ impl_count } [/bold] { impl_word } \n \n "
111+ "[dim]Enter a JSON schema, then one instance to validate.\n "
112+ "Type [bold]q[/bold] to quit.[/dim]" ,
113+ title = "bowtie tui" ,
114+ )
115+ )
117116
118117 while True :
119118 try :
@@ -127,7 +126,7 @@ async def repl(self) -> None:
127126 except ValueError as e :
128127 self ._console .print (
129128 f"[red]Invalid JSON for schema: { e } [/red]" ,
130- )
129+ )
131130 continue
132131
133132 if not _is_schema_like (schema ):
@@ -148,7 +147,7 @@ async def repl(self) -> None:
148147 except ValueError as e :
149148 self ._console .print (
150149 f"[red]Invalid JSON for instance: { e } [/red]" ,
151- )
150+ )
152151 continue
153152
154153 results = await self .run_once (schema = schema , instance = instance )
0 commit comments