From 1162f21b6ceef6e09c84b55927cc72c4930d03d1 Mon Sep 17 00:00:00 2001 From: geekan Date: Tue, 19 Dec 2023 17:11:02 +0800 Subject: [PATCH] refine code --- metagpt/config.py | 12 ++++++++++++ metagpt/startup.py | 5 ----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/metagpt/config.py b/metagpt/config.py index 50ad6a3b2..68b7a2a96 100644 --- a/metagpt/config.py +++ b/metagpt/config.py @@ -131,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 diff --git a/metagpt/startup.py b/metagpt/startup.py index 6ae47213e..a25b71cd0 100644 --- a/metagpt/startup.py +++ b/metagpt/startup.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- import asyncio -from pathlib import Path import typer @@ -42,10 +41,6 @@ def startup( ) from metagpt.team import Team - # 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 CONFIG.update_via_cli(project_path, project_name, inc, reqa_file, max_auto_summarize_code) if not recover_path: