Init
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
from ..Convention.Runtime.Config import *
|
||||
from ..Convention.Runtime.GlobalConfig import ProjectConfig, ConsoleFrontColor
|
||||
from ..CoreModules.flags import set_internal_verbose
|
||||
from ..CoreModules.flags import set_internal_verbose, get_internal_debug
|
||||
from .web import app
|
||||
from argparse import ArgumentParser
|
||||
from typing import *
|
||||
import sys
|
||||
import uvicorn
|
||||
try:
|
||||
import uvicorn
|
||||
except ImportError as ex:
|
||||
ImportingThrow(ex, "Internal", ["uvicorn"])
|
||||
|
||||
def main() -> int:
|
||||
config = ProjectConfig()
|
||||
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument("--main-webhook-url", type=str, default=config.FindItem("main_webhook_url", ""))
|
||||
parser.add_argument("--host", type=str, default=config.FindItem("host", "0.0.0.0"))
|
||||
parser.add_argument("--port", type=int, default=config.FindItem("port", 8000))
|
||||
parser.add_argument("--verbose", type=bool, default=config.FindItem("verbose", False))
|
||||
@@ -22,17 +25,6 @@ def main() -> int:
|
||||
parser.print_help()
|
||||
return 0
|
||||
|
||||
# region Main Webhook URL
|
||||
|
||||
webhook_url = args.main_webhook_url
|
||||
if not webhook_url or webhook_url == "":
|
||||
config.Log("Fatal", f"{ConsoleFrontColor.RED}Main webhook URL is not set{ConsoleFrontColor.RESET}")
|
||||
return 1
|
||||
|
||||
config.Log("Info", f"{ConsoleFrontColor.GREEN}Main webhook URL: {webhook_url}{ConsoleFrontColor.RESET}")
|
||||
|
||||
# endregion Main Webhook URL
|
||||
|
||||
# region Verbose
|
||||
|
||||
verbose = args.verbose
|
||||
|
||||
Reference in New Issue
Block a user