From f7e5324013a38b8652f25431fa7d9c662bdbf348 Mon Sep 17 00:00:00 2001 From: Michael Panchenko Date: Fri, 24 May 2024 14:15:18 +0200 Subject: [PATCH] Formatting --- pyproject.toml | 1 + src/penai/config.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 93187ba..244b394 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -101,6 +101,7 @@ ignore = [ "RET505", "D106", # undocumented public nested class "D205", # blank line after summary (prevents summary-only docstrings, which makes no sense) + "PLW0603", # using global statement ] unfixable = [ diff --git a/src/penai/config.py b/src/penai/config.py index eeab437..c391c35 100644 --- a/src/penai/config.py +++ b/src/penai/config.py @@ -1,6 +1,6 @@ -"""Contains configuration and remote storage utils. +"""Contains configuration and remote storage utils. In its current, default form, configuration will be read from `config.json` and -the git-ignored file `config_local.json` (you have to create it yourself if you need it) and merged. +the git-ignored file `config_local.json` (you have to create it yourself if you need it) and merged. The `config_local.json` is a good place to keep access keys and other secrets. """ @@ -49,6 +49,7 @@ def get_config(reload: bool = False) -> __Configuration: def default_remote_storage() -> RemoteStorage: + """Returns the default remote storage instance. It is created lazily.""" global __remote_storage_instance if __remote_storage_instance is None: __remote_storage_instance = RemoteStorage(get_config().remote_storage) @@ -62,6 +63,7 @@ def pull_from_remote( exclude_regex: Pattern | str | None = None, dryrun: bool = False, ) -> TransactionSummary: + """Pulls from the remote storage using the default storage config.""" return default_remote_storage().pull( remote_path=remote_path, local_base_dir=top_level_directory, @@ -79,6 +81,7 @@ def push_to_remote( exclude_regex: Pattern | str | None = None, dryrun: bool = False, ) -> TransactionSummary: + """Pushes to the remote storage using the default storage config.""" return default_remote_storage().push( path=local_path, local_path_prefix=top_level_directory,