docs: подробные docstring перед каждой функцией
This commit is contained in:
@@ -28,13 +28,16 @@ class Database:
|
||||
self._init_schema()
|
||||
|
||||
def __enter__(self):
|
||||
"""Контекстный менеджер: with Database() as db."""
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
"""Закрытие соединения при выходе из with-блока."""
|
||||
self.close()
|
||||
return False
|
||||
|
||||
def close(self):
|
||||
"""Закрыть соединение с SQLite."""
|
||||
if self.conn:
|
||||
self.conn.close()
|
||||
self.conn = None
|
||||
|
||||
@@ -19,6 +19,7 @@ _DTC_PATH = Path(__file__).parent.parent / "doc" / "dtc_codes.txt"
|
||||
|
||||
|
||||
def _load_dtc_dict() -> dict[str, str]:
|
||||
"""Загрузить справочник DTC-кодов из doc/dtc_codes.txt."""
|
||||
global _DTC_CODES
|
||||
if _DTC_CODES:
|
||||
return _DTC_CODES
|
||||
|
||||
Reference in New Issue
Block a user