@@ -83,48 +83,57 @@ def load(self):
8383 if not is_running (self .background [2 ]):
8484 self .remove_background ()
8585
86- def fill_print_env (self , table ):
87- table .add_row ("Config Path" , self .get_config_file_path ())
86+
87+ def get_env_data (self ):
88+ """
89+ Get environment data as a list of tuples for display.
90+
91+ Returns:
92+ List[Tuple[str, str]]: List of (key, value) tuples for environment data.
93+ """
94+ data = []
95+ data .append (("Config Path" , self .get_config_file_path ()))
8896
8997 launch_extras = ""
9098 if self .config .has_option ("DEFAULT" , "default_workspace" ):
91- table . add_row (
99+ data . append ( (
92100 "Default ComfyUI workspace" ,
93101 self .config ["DEFAULT" ][constants .CONFIG_KEY_DEFAULT_WORKSPACE ],
94- )
95-
102+ ))
96103 launch_extras = self .config ["DEFAULT" ].get (constants .CONFIG_KEY_DEFAULT_LAUNCH_EXTRAS , "" )
97104 else :
98- table . add_row ( "Default ComfyUI workspace" , "No default ComfyUI workspace" )
105+ data . append (( "Default ComfyUI workspace" , "No default ComfyUI workspace" ) )
99106
100107 if launch_extras == "" :
101108 launch_extras = "[bold red]None[/bold red]"
102109
103- table . add_row ( "Default ComfyUI launch extra options" , launch_extras )
110+ data . append (( "Default ComfyUI launch extra options" , launch_extras ) )
104111
105112 if self .config .has_option ("DEFAULT" , constants .CONFIG_KEY_RECENT_WORKSPACE ):
106- table . add_row (
113+ data . append ( (
107114 "Recent ComfyUI workspace" ,
108115 self .config ["DEFAULT" ][constants .CONFIG_KEY_RECENT_WORKSPACE ],
109- )
116+ ))
110117 else :
111- table . add_row ( "Recent ComfyUI workspace" , "No recent run" )
118+ data . append (( "Recent ComfyUI workspace" , "No recent run" ) )
112119
113120 if self .config .has_option ("DEFAULT" , "enable_tracking" ):
114- table . add_row (
121+ data . append ( (
115122 "Tracking Analytics" ,
116123 ("Enabled" if self .config ["DEFAULT" ]["enable_tracking" ] == "True" else "Disabled" ),
117- )
124+ ))
118125
119126 if self .config .has_option ("DEFAULT" , constants .CONFIG_KEY_BACKGROUND ):
120127 bg_info = self .background
121128 if bg_info :
122- table . add_row (
129+ data . append ( (
123130 "Background ComfyUI" ,
124131 f"http://{ bg_info [0 ]} :{ bg_info [1 ]} (pid={ bg_info [2 ]} )" ,
125- )
132+ ))
126133 else :
127- table .add_row ("Background ComfyUI" , "[bold red]No[/bold red]" )
134+ data .append (("Background ComfyUI" , "[bold red]No[/bold red]" ))
135+
136+ return data
128137
129138 def remove_background (self ):
130139 del self .config ["DEFAULT" ]["background" ]
0 commit comments