File tree Expand file tree Collapse file tree 4 files changed +13
-26
lines changed Expand file tree Collapse file tree 4 files changed +13
-26
lines changed Original file line number Diff line number Diff line change @@ -209,7 +209,8 @@ def handle_start(args: argparse.Namespace) -> int:
209209 logger .info ("Starting all modules" )
210210 lab_instance .start_capture ()
211211
212- web_config = lab_instance .config .get ("web" , {})
212+ from opencontext .config .global_config import get_config
213+ web_config = get_config ("web" )
213214 if web_config .get ("enabled" , True ):
214215 # Command line arguments override config file
215216 host = args .host if args .host else web_config .get ("host" , "localhost" )
@@ -232,13 +233,10 @@ def _setup_logging(config_path: Optional[str]) -> None:
232233 Args:
233234 config_path: Optional path to configuration file
234235 """
235- config_manager = ConfigManager ()
236- if config_path :
237- config_manager .load_config (config_path )
238- else :
239- config_manager .update_config (config_manager .get_default_config ())
240-
241- setup_logging (config_manager .get_config ().get ('logging' , {}))
236+ from opencontext .config .global_config import GlobalConfig
237+ GlobalConfig .get_instance ().initialize (config_path )
238+
239+ setup_logging (GlobalConfig .get_instance ().get_config ('logging' ))
242240
243241def main () -> int :
244242 """Main entry point.
Original file line number Diff line number Diff line change @@ -280,7 +280,7 @@ def load_user_settings(self) -> bool:
280280 if not user_settings :
281281 return False
282282 self ._config = self .deep_merge (self ._config , user_settings )
283- logger .info (f"User settings loaded successfully: { user_settings } " )
283+ # logger.info(f"User settings loaded successfully: {user_settings}")
284284 return True
285285 except Exception as e :
286286 logger .error (f"Failed to load user settings: { e } " )
Original file line number Diff line number Diff line change 4949class ComponentInitializer :
5050 """Handles initialization of various OpenContext components."""
5151
52- def __init__ (self , config_manager : ConfigManager = None ):
53- # Backward compatibility: if config_manager is passed, use it; otherwise use global config
54- if config_manager :
55- self .config_manager = config_manager
56- GlobalConfig .get_instance ().set_config_manager (config_manager )
57- else :
58- # Use global config
59- global_config = GlobalConfig .get_instance ()
60- self .config_manager = global_config .get_config_manager ()
52+ def __init__ (self ):
53+ # Use global config
54+ global_config = GlobalConfig .get_instance ()
55+ self .config_manager = global_config .get_config_manager ()
6156
6257 self .config = self .config_manager .get_config () if self .config_manager else GlobalConfig .get_instance ().get_config ()
6358 self .global_config = GlobalConfig .get_instance ()
Original file line number Diff line number Diff line change @@ -33,8 +33,7 @@ class OpenContext:
3333
3434 def __init__ (
3535 self ,
36- config_path : Optional [str ] = None ,
37- config_dict : Optional [Dict [str , Any ]] = None ,
36+ config_path : Optional [str ] = None
3837 ):
3938 """
4039 Initialize OpenContext.
@@ -43,11 +42,6 @@ def __init__(
4342 config_path: Configuration file path
4443 config_dict: Configuration dictionary (unused, kept for compatibility)
4544 """
46- # Initialize configuration manager
47- self .config_manager = ConfigManager ()
48- self .config_manager .load_config (config_path )
49- self .config = self .config_manager .get_config ()
50-
5145 # Initialize core components
5246 self .capture_manager = ContextCaptureManager ()
5347 self .processor_manager = ContextProcessorManager ()
@@ -57,7 +51,7 @@ def __init__(
5751 self .completion_service = None # Smart completion service
5852
5953 # Helper classes
60- self .component_initializer = ComponentInitializer (self . config_manager )
54+ self .component_initializer = ComponentInitializer ()
6155 self .context_operations : Optional [ContextOperations ] = None
6256
6357 # Web server state
You can’t perform that action at this time.
0 commit comments