Skip to content

Commit

Permalink
Working version of the new update
Browse files Browse the repository at this point in the history
  • Loading branch information
morington committed Jun 27, 2024
1 parent 9d4c280 commit e40ed2b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
13 changes: 12 additions & 1 deletion confhub/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ def __init__(
developer_mode: bool = False,
logger_regs: Optional[list[LoggerReg]] = None,
) -> None:
"""
Example:
import dataclasses
from confhub import Confhub
if __name__ == '__main__':
data: type[dataclasses.dataclass] = Confhub(developer_mode=False).data
print(data.postgresql.host)
"""
service_data = get_service_data()
_config_path = service_data.get('configs_path')
if not _config_path or not isinstance(_config_path, str):
Expand Down Expand Up @@ -50,4 +61,4 @@ def __load(self, *models: BlockCore, files: List[str | Path]) -> Type[dataclasse

__fields_from_dataclass.append((block.__block__, type(block), dataclasses.field(default=value)))

return dataclasses.make_dataclass('Data', __fields_from_dataclass)
return dataclasses.make_dataclass('Data', __fields_from_dataclass)
9 changes: 0 additions & 9 deletions main_test.py

This file was deleted.

0 comments on commit e40ed2b

Please sign in to comment.