From 9026f021ed1a492a36fc5e78cef6d9486d2eeb18 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Mon, 17 May 2021 17:13:36 +0200 Subject: [PATCH] Improved docs for cpl.database --- src/cpl/database/connection/database_connection.py | 10 ++++++---- src/cpl/database/connection/database_connection_abc.py | 1 + src/cpl/database/context/database_context.py | 6 ++++++ src/cpl/database/context/database_context_abc.py | 1 + src/cpl/database/database_settings.py | 1 + 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/cpl/database/connection/database_connection.py b/src/cpl/database/connection/database_connection.py index 87f77758..551ce238 100644 --- a/src/cpl/database/connection/database_connection.py +++ b/src/cpl/database/connection/database_connection.py @@ -10,12 +10,14 @@ from cpl.database.database_settings import DatabaseSettings class DatabaseConnection(DatabaseConnectionABC): + r"""Representation of the database connection + + Parameter + --------- + database_settings: :class:`cpl.database.database_settings.DatabaseSettings` + """ def __init__(self, database_settings: DatabaseSettings): - """ - Represents an connection to a database - :param database_settings: - """ DatabaseConnectionABC.__init__(self) self._db_settings = database_settings diff --git a/src/cpl/database/connection/database_connection_abc.py b/src/cpl/database/connection/database_connection_abc.py index c4d6df13..637c1da7 100644 --- a/src/cpl/database/connection/database_connection_abc.py +++ b/src/cpl/database/connection/database_connection_abc.py @@ -5,6 +5,7 @@ from sqlalchemy.orm import Session class DatabaseConnectionABC(ABC): + r"""ABC for the :class:`cpl.database.connection.database_connection.DatabaseConnection`""" @abstractmethod def __init__(self): pass diff --git a/src/cpl/database/context/database_context.py b/src/cpl/database/context/database_context.py index c07f1acd..e331c9e5 100644 --- a/src/cpl/database/context/database_context.py +++ b/src/cpl/database/context/database_context.py @@ -11,6 +11,12 @@ from cpl.database.database_model import DatabaseModel class DatabaseContext(DatabaseContextABC): + r"""Representation of the database context + + Parameter + --------- + database_settings: :class:`cpl.database.database_settings.DatabaseSettings` + """ def __init__(self, database_settings: DatabaseSettings): DatabaseContextABC.__init__(self) diff --git a/src/cpl/database/context/database_context_abc.py b/src/cpl/database/context/database_context_abc.py index 4aaed5a9..0587560c 100644 --- a/src/cpl/database/context/database_context_abc.py +++ b/src/cpl/database/context/database_context_abc.py @@ -5,6 +5,7 @@ from sqlalchemy.orm import Session class DatabaseContextABC(ABC): + r"""ABC for the :class:`cpl.database.context.database_context.DatabaseContext`""" @abstractmethod def __init__(self, *args): diff --git a/src/cpl/database/database_settings.py b/src/cpl/database/database_settings.py index 70cda14e..08f04b3f 100644 --- a/src/cpl/database/database_settings.py +++ b/src/cpl/database/database_settings.py @@ -8,6 +8,7 @@ from cpl.database.database_settings_name_enum import DatabaseSettingsNameEnum class DatabaseSettings(ConfigurationModelABC): + r"""Represents settings for the database connection""" def __init__(self): ConfigurationModelABC.__init__(self)