mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-25 08:46:48 +02:00
refine code
This commit is contained in:
parent
7f04ec2060
commit
2bae7f2bfb
2 changed files with 13 additions and 5 deletions
|
|
@ -45,6 +45,7 @@ class Config(metaclass=Singleton):
|
|||
default_yaml_file = METAGPT_ROOT / "config/config.yaml"
|
||||
|
||||
def __init__(self, yaml_file=default_yaml_file):
|
||||
self._init_cli_paras()
|
||||
self._init_with_config_files_and_env(yaml_file)
|
||||
self._update()
|
||||
logger.debug("Config loading done.")
|
||||
|
|
@ -130,8 +131,20 @@ class Config(metaclass=Singleton):
|
|||
self.workspace_path = Path(self._get("WORKSPACE_PATH", DEFAULT_WORKSPACE_ROOT))
|
||||
self._ensure_workspace_exists()
|
||||
|
||||
def _init_cli_paras(self):
|
||||
self.project_path = None
|
||||
self.project_name = None
|
||||
self.inc = None
|
||||
self.reqa_file = None
|
||||
self.max_auto_summarize_code = None
|
||||
|
||||
def update_via_cli(self, project_path, project_name, inc, reqa_file, max_auto_summarize_code):
|
||||
"""update config via cli"""
|
||||
|
||||
# Use in the PrepareDocuments action according to Section 2.2.3.5.1 of RFC 135.
|
||||
if project_path:
|
||||
inc = True
|
||||
project_name = project_name or Path(project_path).name
|
||||
self.project_path = project_path
|
||||
self.project_name = project_name
|
||||
self.inc = inc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue