Commit 6e3b40f8 authored by harshavardhan.c's avatar harshavardhan.c

Project structure for new maintenance logbook

parent d345e786
...@@ -15,9 +15,9 @@ authMechanism= ...@@ -15,9 +15,9 @@ authMechanism=
mongo_constants_file_path= conf/mongo_encryption_constants.json mongo_constants_file_path= conf/mongo_encryption_constants.json
[DB] [DB]
type = postgres type = postgresql
host = localhost host = localhost
port = 2717 port = 5432
username = username =
password = password =
name = ilens_logbook name = postgres
\ No newline at end of file \ No newline at end of file
...@@ -6,7 +6,7 @@ from pydantic import BaseSettings ...@@ -6,7 +6,7 @@ from pydantic import BaseSettings
from __root__ import path from __root__ import path
config = ConfigParser()
db_folder_path = os.path.join(path(), 'db') db_folder_path = os.path.join(path(), 'db')
try: try:
_config = SafeConfigParser() _config = SafeConfigParser()
...@@ -37,6 +37,8 @@ class _Configuration(BaseSettings): ...@@ -37,6 +37,8 @@ class _Configuration(BaseSettings):
MONGO_ENCRYPTION_FILE_PATH: str = _config.get("MONGO_DB", "mongo_constants_file_path", MONGO_ENCRYPTION_FILE_PATH: str = _config.get("MONGO_DB", "mongo_constants_file_path",
fallback="conf/mongo_encryption_constants.json") fallback="conf/mongo_encryption_constants.json")
LOG_LEVEL: str = _config.get("LOG", "level", fallback="trace")
DB_TYPE: str = _config.get('DB', 'type', fallback='postgres') DB_TYPE: str = _config.get('DB', 'type', fallback='postgres')
DB_HOST: str = _config.get('DB', 'host', fallback='localhost') DB_HOST: str = _config.get('DB', 'host', fallback='localhost')
DB_PORT: int = _config.get('DB', 'port', fallback=2717) DB_PORT: int = _config.get('DB', 'port', fallback=2717)
...@@ -83,3 +85,7 @@ class SqlDB(object): ...@@ -83,3 +85,7 @@ class SqlDB(object):
DB_PASSWORD = _conf.DB_PASSWORD DB_PASSWORD = _conf.DB_PASSWORD
DB_NAME = _conf.DB_NAME DB_NAME = _conf.DB_NAME
SQLITE_DEFAULT_DB_PATH = _conf.SQLITE_DEFAULT_DB_PATH SQLITE_DEFAULT_DB_PATH = _conf.SQLITE_DEFAULT_DB_PATH
class Log(object):
LOG_LEVEL = _conf.LOG_LEVEL
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment