@@ -25,40 +25,36 @@ def print_server_config(server_config: ServerConfig, is_stashed=False):
25
25
else :
26
26
console .print (f"[bold cyan]{ server_config .name } [/]" )
27
27
28
- if isinstance (server_config , ( RemoteServerConfig , RemoteServerConfig ) ):
28
+ if isinstance (server_config , RemoteServerConfig ):
29
29
console .print (f" Url: [green]{ server_config .url } [/]" )
30
- headers = getattr ( server_config , " headers" , None )
30
+ headers = server_config . headers
31
31
if headers :
32
32
console .print (" Headers:" )
33
33
for key , value in headers .items ():
34
34
console .print (f' [bold blue]{ key } [/] = [green]"{ value } "[/]' )
35
35
console .print (" " + "-" * 50 )
36
36
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 } "[/]' )
58
53
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 )
62
58
63
59
64
60
def print_servers_table (servers ):
0 commit comments