@@ -25,40 +25,36 @@ def print_server_config(server_config: ServerConfig, is_stashed=False):
2525 else :
2626 console .print (f"[bold cyan]{ server_config .name } [/]" )
2727
28- if isinstance (server_config , ( RemoteServerConfig , RemoteServerConfig ) ):
28+ if isinstance (server_config , RemoteServerConfig ):
2929 console .print (f" Url: [green]{ server_config .url } [/]" )
30- headers = getattr ( server_config , " headers" , None )
30+ headers = server_config . headers
3131 if headers :
3232 console .print (" Headers:" )
3333 for key , value in headers .items ():
3434 console .print (f' [bold blue]{ key } [/] = [green]"{ value } "[/]' )
3535 console .print (" " + "-" * 50 )
3636 return
37- elif hasattr (server_config , "command" ) and hasattr (server_config , "args" ) and hasattr (server_config , "env" ):
38- command = server_config .command
39- console .print (f" Command: [green]{ command } [/]" )
40-
41- # Display arguments
42- args = server_config .args
43- if args :
44- console .print (" Arguments:" )
45- for i , arg in enumerate (args ):
46- console .print (f" { i } : [yellow]{ escape (arg )} [/]" )
47-
48- # Display environment variables
49- env_vars = server_config .env
50- if env_vars :
51- console .print (" Environment Variables:" )
52- for key , value in env_vars .items ():
53- console .print (f' [bold blue]{ key } [/] = [green]"{ value } "[/]' )
54- else :
55- console .print (" Environment Variables: [italic]None[/]" )
56- console .print (" " + "-" * 50 )
57- return
37+ command = server_config .command
38+ console .print (f" Command: [green]{ command } [/]" )
39+
40+ # Display arguments
41+ args = server_config .args
42+ if args :
43+ console .print (" Arguments:" )
44+ for i , arg in enumerate (args ):
45+ console .print (f" { i } : [yellow]{ escape (arg )} [/]" )
46+
47+ # Display environment variables
48+ env_vars = server_config .env
49+ if env_vars :
50+ console .print (" Environment Variables:" )
51+ for key , value in env_vars .items ():
52+ console .print (f' [bold blue]{ key } [/] = [green]"{ value } "[/]' )
5853 else :
59- console .print ("[red]Unknown server config type![/]" )
60- console .print (" " + "-" * 50 )
61- return
54+ console .print (" Environment Variables: [italic]None[/]" )
55+
56+ # Add a separator line between servers
57+ console .print (" " + "-" * 50 )
6258
6359
6460def print_servers_table (servers ):
0 commit comments