Make notion use config get env
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, ClassVar
|
||||
|
||||
from dotenv import dotenv_values, load_dotenv, set_key, unset_key
|
||||
from dotenv import dotenv_values, set_key, unset_key
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections import OrderedDict
|
||||
@@ -13,15 +12,11 @@ config_path = Path(__file__).parent.resolve()
|
||||
DOT_ENV_PATH = Path(config_path, ".env")
|
||||
DOT_ENV_PATH.touch(mode=0o600, exist_ok=True)
|
||||
|
||||
load_dotenv()
|
||||
|
||||
VERSION = "1.5"
|
||||
NOTION_TOKEN = os.getenv("NOTION_TOKEN")
|
||||
|
||||
|
||||
class Config:
|
||||
env_dict: ClassVar[OrderedDict[str, str]] = {}
|
||||
dot_env_path = DOT_ENV_PATH
|
||||
VERSION = "1.5"
|
||||
|
||||
@staticmethod
|
||||
def init(dotenv_path: str = DOT_ENV_PATH) -> None:
|
||||
|
||||
Reference in New Issue
Block a user