将ProjectConfig加入Architecture
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
from ..Convention.Runtime.Config import *
|
||||
from ..Convention.Runtime.Architecture import Architecture
|
||||
from ..Convention.Runtime.GlobalConfig import ProjectConfig, ConsoleFrontColor
|
||||
from ..CoreModules.flags import set_internal_verbose, get_internal_debug
|
||||
|
||||
Architecture.Register(ProjectConfig, ProjectConfig(), lambda: None)
|
||||
|
||||
from ..CoreModules.flags import set_internal_verbose
|
||||
from .web import app
|
||||
from argparse import ArgumentParser
|
||||
from typing import *
|
||||
@@ -11,7 +15,7 @@ except ImportError as ex:
|
||||
ImportingThrow(ex, "Internal", ["uvicorn"])
|
||||
|
||||
def main() -> int:
|
||||
config = ProjectConfig()
|
||||
config: ProjectConfig = Architecture.Get(ProjectConfig)
|
||||
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument("--host", type=str, default=config.FindItem("host", "0.0.0.0"))
|
||||
|
||||
Reference in New Issue
Block a user