:chore: Initialisation du projet
This commit is contained in:
1 parent
75a8c6addd
commit
6278d19618
27 files changed
+4418
-81
No files matched your search
@@ -0,0 +1,20 @@
|
||||
from pathlib import Path
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class AppSettings(BaseSettings):
|
||||
config_dir: Path = Path("./config")
|
||||
database_url: str | None = None
|
||||
|
||||
model_config = SettingsConfigDict(env_prefix="MKVTOOL_", env_file=".env")
|
||||
|
||||
@property
|
||||
def resolved_database_url(self) -> str:
|
||||
if self.database_url:
|
||||
return self.database_url
|
||||
return f"sqlite:///{self.config_dir / 'mkvtool.db'}"
|
||||
|
||||
|
||||
settings = AppSettings()
|
||||
|
||||
Reference in new issue
Block a user