From 24bf8794f38785420564480a6641370821325cec Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 23:08:31 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black-pre-commit-mirror: 26.5.1 → 26.10.0](https://github.com/psf/black-pre-commit-mirror/compare/26.5.1...26.10.0) - [github.com/astral-sh/ruff-pre-commit: v0.15.20 → v0.16.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.20...v0.16.10) - [github.com/pycqa/isort: 9.0.0a3 → 9.0.2](https://github.com/pycqa/isort/compare/9.0.0a3...9.0.2) - [github.com/pycqa/flake8: 7.3.0 → 7.4.1](https://github.com/pycqa/flake8/compare/7.3.0...7.4.1) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 479df6a..0f70724 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,21 +37,21 @@ repos: - "--py310-plus" - repo: https://github.com/psf/black-pre-commit-mirror - rev: 26.5.1 + rev: 26.10.0 hooks: - id: black args: - --target-version=py310 - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.20 + rev: v0.16.10 hooks: - id: ruff-check args: - --fix-only - repo: https://github.com/pycqa/isort - rev: 9.0.0a3 + rev: 9.0.2 hooks: - id: isort args: @@ -60,7 +60,7 @@ repos: - --filter-files - repo: https://github.com/pycqa/flake8 - rev: 7.3.0 + rev: 7.4.1 hooks: - id: flake8 language: python From a9bf37028d74352853dbc4013ef6b8d7ba036e79 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 23:09:00 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- builder/pyinstaller_build_macos.py | 4 ++-- builder/pyinstaller_build_ubuntu.py | 4 ++-- builder/pyinstaller_build_windows.py | 4 ++-- builder/version_info_templater.py | 2 +- geotribu_cli/__about__.py | 2 +- geotribu_cli/__init__.py | 2 +- geotribu_cli/cli.py | 2 +- geotribu_cli/cli_results_rich_formatters.py | 2 +- geotribu_cli/comments/__init__.py | 2 +- geotribu_cli/comments/comments_broadcast.py | 2 +- geotribu_cli/comments/comments_latest.py | 2 +- geotribu_cli/comments/comments_open.py | 2 +- geotribu_cli/comments/comments_toolbelt.py | 5 ++--- geotribu_cli/comments/mdl_comment.py | 2 +- geotribu_cli/console.py | 2 +- geotribu_cli/constants.py | 2 +- geotribu_cli/content/new_article.py | 2 +- geotribu_cli/content/yaml_handler.py | 2 +- geotribu_cli/history.py | 5 ++--- geotribu_cli/images/images_optimizer.py | 2 +- geotribu_cli/images/optim_pillow.py | 2 +- geotribu_cli/images/optim_tinify.py | 2 +- geotribu_cli/json/json_client.py | 2 +- geotribu_cli/rss/mdl_rss.py | 2 +- geotribu_cli/rss/rss_reader.py | 15 ++++----------- geotribu_cli/search/mdl_search.py | 2 +- geotribu_cli/search/search_content.py | 12 +++--------- geotribu_cli/search/search_image.py | 11 +++-------- geotribu_cli/social/cmd_mastodon_export.py | 2 +- geotribu_cli/social/mastodon_client.py | 2 +- geotribu_cli/subcommands/__init__.py | 2 +- geotribu_cli/subcommands/open_result.py | 2 +- geotribu_cli/subcommands/upgrade.py | 9 ++------- geotribu_cli/utils/args_types.py | 2 +- geotribu_cli/utils/check_image_size.py | 2 +- geotribu_cli/utils/check_path.py | 3 +-- geotribu_cli/utils/dates_manipulation.py | 6 ++---- geotribu_cli/utils/file_downloader.py | 2 +- geotribu_cli/utils/file_stats.py | 2 +- geotribu_cli/utils/formatters.py | 2 +- geotribu_cli/utils/journalizer.py | 2 +- geotribu_cli/utils/proxies.py | 3 +-- geotribu_cli/utils/slugger.py | 2 +- geotribu_cli/utils/str2bool.py | 2 +- geotribu_cli/utils/url_helpers.py | 3 +-- tests/test_about.py | 2 +- tests/test_cli.py | 2 +- tests/test_constants.py | 2 +- tests/test_utils_args_types.py | 2 +- tests/test_utils_check_path.py | 2 +- tests/test_utils_date_helpers.py | 2 +- tests/test_utils_file_stats.py | 2 +- tests/test_utils_formatters.py | 2 +- tests/test_utils_images_size.py | 2 +- tests/test_utils_proxies.py | 2 +- tests/test_utils_slugifier.py | 2 +- tests/test_utils_str2bool.py | 6 +++--- tests/test_utils_url_helpers.py | 2 +- 58 files changed, 74 insertions(+), 104 deletions(-) diff --git a/builder/pyinstaller_build_macos.py b/builder/pyinstaller_build_macos.py index d3af136..49acbfa 100644 --- a/builder/pyinstaller_build_macos.py +++ b/builder/pyinstaller_build_macos.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Launch PyInstaller using a Python script. @@ -19,7 +19,7 @@ # package sys.path.insert(0, str(Path(".").resolve())) -from geotribu_cli import __about__ # noqa: E402 +from geotribu_cli import __about__ # ############################################################################# # ########### MAIN ################# diff --git a/builder/pyinstaller_build_ubuntu.py b/builder/pyinstaller_build_ubuntu.py index 1f7708b..cb1c6e7 100644 --- a/builder/pyinstaller_build_ubuntu.py +++ b/builder/pyinstaller_build_ubuntu.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Launch PyInstaller using a Python script. @@ -19,7 +19,7 @@ # package sys.path.insert(0, str(Path(".").resolve())) -from geotribu_cli import __about__ # noqa: E402 +from geotribu_cli import __about__ # ############################################################################# # ########### MAIN ################# diff --git a/builder/pyinstaller_build_windows.py b/builder/pyinstaller_build_windows.py index c445a58..f0d355c 100644 --- a/builder/pyinstaller_build_windows.py +++ b/builder/pyinstaller_build_windows.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Launch PyInstaller using a Python script. @@ -19,7 +19,7 @@ # package sys.path.insert(0, str(Path(".").resolve())) -from geotribu_cli import __about__ # noqa: E402 +from geotribu_cli import __about__ # ############################################################################# # ########### MAIN ################# diff --git a/builder/version_info_templater.py b/builder/version_info_templater.py index b52e5ed..e2efb70 100644 --- a/builder/version_info_templater.py +++ b/builder/version_info_templater.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Microsoft Version Info templater. diff --git a/geotribu_cli/__about__.py b/geotribu_cli/__about__.py index eb9619c..d2a57b7 100644 --- a/geotribu_cli/__about__.py +++ b/geotribu_cli/__about__.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Abstraction on the package metadata to easily retrieve them.""" diff --git a/geotribu_cli/__init__.py b/geotribu_cli/__init__.py index 8c446ac..0d7d3d1 100644 --- a/geotribu_cli/__init__.py +++ b/geotribu_cli/__init__.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # submodules from .__about__ import __version__ # noqa: F401 diff --git a/geotribu_cli/cli.py b/geotribu_cli/cli.py index af67a20..89bcdf1 100644 --- a/geotribu_cli/cli.py +++ b/geotribu_cli/cli.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # PYTHON_ARGCOMPLETE_OK """Main CLI entrypoint.""" diff --git a/geotribu_cli/cli_results_rich_formatters.py b/geotribu_cli/cli_results_rich_formatters.py index d6529f9..03601ef 100644 --- a/geotribu_cli/cli_results_rich_formatters.py +++ b/geotribu_cli/cli_results_rich_formatters.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/comments/__init__.py b/geotribu_cli/comments/__init__.py index 905f091..752792c 100644 --- a/geotribu_cli/comments/__init__.py +++ b/geotribu_cli/comments/__init__.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # submodules from .comments_broadcast import parser_comments_broadcast # noqa: F401 diff --git a/geotribu_cli/comments/comments_broadcast.py b/geotribu_cli/comments/comments_broadcast.py index 97d5262..08674b4 100644 --- a/geotribu_cli/comments/comments_broadcast.py +++ b/geotribu_cli/comments/comments_broadcast.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/comments/comments_latest.py b/geotribu_cli/comments/comments_latest.py index c0c7fc6..7be7a16 100644 --- a/geotribu_cli/comments/comments_latest.py +++ b/geotribu_cli/comments/comments_latest.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/comments/comments_open.py b/geotribu_cli/comments/comments_open.py index ea42561..dce565e 100644 --- a/geotribu_cli/comments/comments_open.py +++ b/geotribu_cli/comments/comments_open.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/comments/comments_toolbelt.py b/geotribu_cli/comments/comments_toolbelt.py index ce958ce..9f11e18 100644 --- a/geotribu_cli/comments/comments_toolbelt.py +++ b/geotribu_cli/comments/comments_toolbelt.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# @@ -183,8 +183,7 @@ def get_latest_comments( list of comments objects """ # check if count is acceptable - if number < 1: - number = 1 + number = max(number, 1) # download remote latest comments comments_file = download_remote_file_to_local( diff --git a/geotribu_cli/comments/mdl_comment.py b/geotribu_cli/comments/mdl_comment.py index b2eba4b..95bef5c 100644 --- a/geotribu_cli/comments/mdl_comment.py +++ b/geotribu_cli/comments/mdl_comment.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Package constants.""" diff --git a/geotribu_cli/console.py b/geotribu_cli/console.py index 3855950..6a9b35a 100644 --- a/geotribu_cli/console.py +++ b/geotribu_cli/console.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Shared console instance. diff --git a/geotribu_cli/constants.py b/geotribu_cli/constants.py index 995abf5..8eed495 100644 --- a/geotribu_cli/constants.py +++ b/geotribu_cli/constants.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Package constants.""" diff --git a/geotribu_cli/content/new_article.py b/geotribu_cli/content/new_article.py index 448c942..1048690 100644 --- a/geotribu_cli/content/new_article.py +++ b/geotribu_cli/content/new_article.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/content/yaml_handler.py b/geotribu_cli/content/yaml_handler.py index 776050c..68679d9 100644 --- a/geotribu_cli/content/yaml_handler.py +++ b/geotribu_cli/content/yaml_handler.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # 3rd party from frontmatter import YAMLHandler diff --git a/geotribu_cli/history.py b/geotribu_cli/history.py index 2c17384..2d8c56f 100644 --- a/geotribu_cli/history.py +++ b/geotribu_cli/history.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Store and load CLI history.""" @@ -61,8 +61,7 @@ def dump( out_history.write(f"{request_performed}\n") # results - for i in results_to_dump: - out_history.write(f"{i.get(key_field)}\n") + out_history.writelines(f"{i.get(key_field)}\n" for i in results_to_dump) logger.debug(f"History saved for {cmd_name}") diff --git a/geotribu_cli/images/images_optimizer.py b/geotribu_cli/images/images_optimizer.py index 20cc34b..4a00c12 100644 --- a/geotribu_cli/images/images_optimizer.py +++ b/geotribu_cli/images/images_optimizer.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/images/optim_pillow.py b/geotribu_cli/images/optim_pillow.py index ecceead..ee63071 100644 --- a/geotribu_cli/images/optim_pillow.py +++ b/geotribu_cli/images/optim_pillow.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/images/optim_tinify.py b/geotribu_cli/images/optim_tinify.py index c0331a2..f8a5556 100644 --- a/geotribu_cli/images/optim_tinify.py +++ b/geotribu_cli/images/optim_tinify.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/json/json_client.py b/geotribu_cli/json/json_client.py index 7cf341b..458fab2 100644 --- a/geotribu_cli/json/json_client.py +++ b/geotribu_cli/json/json_client.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """JSON Feed client.""" diff --git a/geotribu_cli/rss/mdl_rss.py b/geotribu_cli/rss/mdl_rss.py index f1d7224..46ed425 100644 --- a/geotribu_cli/rss/mdl_rss.py +++ b/geotribu_cli/rss/mdl_rss.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Package constants.""" diff --git a/geotribu_cli/rss/rss_reader.py b/geotribu_cli/rss/rss_reader.py index a354712..3da7267 100644 --- a/geotribu_cli/rss/rss_reader.py +++ b/geotribu_cli/rss/rss_reader.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# @@ -220,12 +220,7 @@ def run(args: argparse.Namespace): # filter on content type if args.filter_type == "article" and not item.find( "link" - ).text.startswith(f"{defaults_settings.site_base_url}articles/"): - logger.debug( - f"Résultat ignoré par le filtre {args.filter_type}: {item.find('link').text}" - ) - continue - elif args.filter_type == "rdp" and not item.find( + ).text.startswith(f"{defaults_settings.site_base_url}articles/") or args.filter_type == "rdp" and not item.find( "link" ).text.startswith(f"{defaults_settings.site_base_url}rdp/"): logger.debug( @@ -251,9 +246,7 @@ def run(args: argparse.Namespace): ) ) except Exception as err: - err_msg = "Feed item (index = {}) triggers an error. Trace: {}".format( - feed_items.index(item), err - ) + err_msg = f"Feed item (index = {feed_items.index(item)}) triggers an error. Trace: {err}" logger.error(err_msg) sys.exit(err_msg) @@ -276,7 +269,7 @@ def run(args: argparse.Namespace): prompt="Afficher le résultat n° (q pour quitter)", console=console, choices=["q"] - + [str(i) for i in range(0, min([len(feed_items), args.results_number]))], + + [str(i) for i in range(min([len(feed_items), args.results_number]))], default="q", ) diff --git a/geotribu_cli/search/mdl_search.py b/geotribu_cli/search/mdl_search.py index 056fc03..c2afa32 100644 --- a/geotribu_cli/search/mdl_search.py +++ b/geotribu_cli/search/mdl_search.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Search related models.""" diff --git a/geotribu_cli/search/search_content.py b/geotribu_cli/search/search_content.py index 915fa08..53ab902 100644 --- a/geotribu_cli/search/search_content.py +++ b/geotribu_cli/search/search_content.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# @@ -389,13 +389,7 @@ def run(args: argparse.Namespace): # filter on content type if args.filter_type == "article" and not result.get("ref").startswith( "articles/" - ): - logger.debug( - f"Résultat ignoré par le filtre {args.filter_type}: {result.get('ref')}" - ) - count_ignored_results += 1 - continue - elif args.filter_type == "rdp" and not result.get("ref").startswith("rdp/"): + ) or args.filter_type == "rdp" and not result.get("ref").startswith("rdp/"): logger.debug( f"Résultat ignoré par le filtre {args.filter_type}: {result.get('ref')}" ) @@ -500,7 +494,7 @@ def run(args: argparse.Namespace): console=console, choices=["q"] + [ - str(i) for i in range(0, min([len(final_results), args.results_number])) + str(i) for i in range(min([len(final_results), args.results_number])) ], default="q", ) diff --git a/geotribu_cli/search/search_image.py b/geotribu_cli/search/search_image.py index f2f7a7a..08d9f8f 100644 --- a/geotribu_cli/search/search_image.py +++ b/geotribu_cli/search/search_image.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# @@ -198,12 +198,7 @@ def run(args: argparse.Namespace): # filter on image type if args.filter_type == "logo" and not result.get("ref").startswith( "logos-icones/" - ): - logger.debug( - f"Résultat ignoré par le filtre {args.filter_type}: {result.get('ref')}" - ) - continue - elif args.filter_type == "geoicone" and not result.get("ref").startswith( + ) or args.filter_type == "geoicone" and not result.get("ref").startswith( "internal/icons-rdp-news/" ): logger.debug( @@ -259,7 +254,7 @@ def run(args: argparse.Namespace): console=console, choices=["q"] + [ - str(i) for i in range(0, min([len(final_results), args.results_number])) + str(i) for i in range(min([len(final_results), args.results_number])) ], default="q", ) diff --git a/geotribu_cli/social/cmd_mastodon_export.py b/geotribu_cli/social/cmd_mastodon_export.py index b937854..f3db840 100644 --- a/geotribu_cli/social/cmd_mastodon_export.py +++ b/geotribu_cli/social/cmd_mastodon_export.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/social/mastodon_client.py b/geotribu_cli/social/mastodon_client.py index d443826..f6e29f6 100644 --- a/geotribu_cli/social/mastodon_client.py +++ b/geotribu_cli/social/mastodon_client.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/subcommands/__init__.py b/geotribu_cli/subcommands/__init__.py index c38d43d..270b36f 100644 --- a/geotribu_cli/subcommands/__init__.py +++ b/geotribu_cli/subcommands/__init__.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 F401 +#! python3 # submodules from geotribu_cli.comments import parser_comments_broadcast # noqa: F401 diff --git a/geotribu_cli/subcommands/open_result.py b/geotribu_cli/subcommands/open_result.py index 558aa10..b9c91fa 100644 --- a/geotribu_cli/subcommands/open_result.py +++ b/geotribu_cli/subcommands/open_result.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ # ########## IMPORTS ############# diff --git a/geotribu_cli/subcommands/upgrade.py b/geotribu_cli/subcommands/upgrade.py index b046eae..ec6946a 100644 --- a/geotribu_cli/subcommands/upgrade.py +++ b/geotribu_cli/subcommands/upgrade.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Sub-command in charge of checking if new versions are available. @@ -70,11 +70,7 @@ def get_download_url_for_os( opersys_code = override_opersys for asset in release_assets: - if opersys_code == "win32" and "Windows" in asset.get("name"): - return asset.get("browser_download_url"), asset.get("content-type") - elif opersys_code == "linux" and "Ubuntu" in asset.get("name"): - return asset.get("browser_download_url"), asset.get("content-type") - elif opersys_code == "darwin" and "MacOS" in asset.get("name"): + if opersys_code == "win32" and "Windows" in asset.get("name") or opersys_code == "linux" and "Ubuntu" in asset.get("name") or opersys_code == "darwin" and "MacOS" in asset.get("name"): return asset.get("browser_download_url"), asset.get("content-type") else: continue @@ -281,4 +277,3 @@ def run(args: argparse.Namespace): # ################################## if __name__ == "__main__": """Standalone execution.""" - pass diff --git a/geotribu_cli/utils/args_types.py b/geotribu_cli/utils/args_types.py index 2e38951..83e1f51 100644 --- a/geotribu_cli/utils/args_types.py +++ b/geotribu_cli/utils/args_types.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Static objects and variables.""" diff --git a/geotribu_cli/utils/check_image_size.py b/geotribu_cli/utils/check_image_size.py index 2fcfffa..d2510b2 100644 --- a/geotribu_cli/utils/check_image_size.py +++ b/geotribu_cli/utils/check_image_size.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Check image size using pure Python . diff --git a/geotribu_cli/utils/check_path.py b/geotribu_cli/utils/check_path.py index bf6ccbf..dd4f218 100755 --- a/geotribu_cli/utils/check_path.py +++ b/geotribu_cli/utils/check_path.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Helpers to check file: readable, exists, etc.. @@ -241,4 +241,3 @@ def check_path( if __name__ == "__main__": """Standalone execution.""" - pass diff --git a/geotribu_cli/utils/dates_manipulation.py b/geotribu_cli/utils/dates_manipulation.py index 8131a37..d8bbb92 100644 --- a/geotribu_cli/utils/dates_manipulation.py +++ b/geotribu_cli/utils/dates_manipulation.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Extract date from content path, location or name. @@ -86,8 +86,7 @@ def get_date_from_content_location(input_content_location: str) -> date: next_part = parts[parts.index(year) + 1] # clean next part for rdp - if next_part.startswith("rdp_"): - next_part = next_part[4:] + next_part = next_part.removeprefix("rdp_") # now, the next part should contain the date within the first 10 chars date_str = next_part[:10] @@ -127,4 +126,3 @@ def get_days_until_next_month(from_date: date = None) -> int: if __name__ == "__main__": """Standalone execution.""" - pass diff --git a/geotribu_cli/utils/file_downloader.py b/geotribu_cli/utils/file_downloader.py index 98b1ea6..27ee7b9 100644 --- a/geotribu_cli/utils/file_downloader.py +++ b/geotribu_cli/utils/file_downloader.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 # ############################################################################ diff --git a/geotribu_cli/utils/file_stats.py b/geotribu_cli/utils/file_stats.py index 874a9a7..2f8fa26 100644 --- a/geotribu_cli/utils/file_stats.py +++ b/geotribu_cli/utils/file_stats.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Check file statistcs.""" diff --git a/geotribu_cli/utils/formatters.py b/geotribu_cli/utils/formatters.py index 0dc87dd..15dc044 100644 --- a/geotribu_cli/utils/formatters.py +++ b/geotribu_cli/utils/formatters.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Helpers to format text and variables.""" diff --git a/geotribu_cli/utils/journalizer.py b/geotribu_cli/utils/journalizer.py index 84d51db..92f170b 100644 --- a/geotribu_cli/utils/journalizer.py +++ b/geotribu_cli/utils/journalizer.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """Helper to configure logging depending on CLI options.""" diff --git a/geotribu_cli/utils/proxies.py b/geotribu_cli/utils/proxies.py index 0a180be..86a49b1 100644 --- a/geotribu_cli/utils/proxies.py +++ b/geotribu_cli/utils/proxies.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Small module to get network proxies configuration. @@ -98,4 +98,3 @@ def get_proxy_settings() -> dict: if __name__ == "__main__": """Standalone execution.""" - pass diff --git a/geotribu_cli/utils/slugger.py b/geotribu_cli/utils/slugger.py index c18424c..6a09957 100644 --- a/geotribu_cli/utils/slugger.py +++ b/geotribu_cli/utils/slugger.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Minimalist slugifier. diff --git a/geotribu_cli/utils/str2bool.py b/geotribu_cli/utils/str2bool.py index d2bd9ea..a644250 100644 --- a/geotribu_cli/utils/str2bool.py +++ b/geotribu_cli/utils/str2bool.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Basic string to bool. diff --git a/geotribu_cli/utils/url_helpers.py b/geotribu_cli/utils/url_helpers.py index 7789b77..824503f 100644 --- a/geotribu_cli/utils/url_helpers.py +++ b/geotribu_cli/utils/url_helpers.py @@ -1,4 +1,4 @@ -#! python3 # noqa: E265 +#! python3 """ Helpers to check file: readable, exists, etc.. @@ -83,4 +83,3 @@ def check_str_is_url( if __name__ == "__main__": """Standalone execution.""" - pass diff --git a/tests/test_about.py b/tests/test_about.py index 20855fb..4dae6a2 100644 --- a/tests/test_about.py +++ b/tests/test_about.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_cli.py b/tests/test_cli.py index 29facb6..6a9d68c 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_constants.py b/tests/test_constants.py index 092f2e2..054ba89 100644 --- a/tests/test_constants.py +++ b/tests/test_constants.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_utils_args_types.py b/tests/test_utils_args_types.py index 52eac41..1505437 100644 --- a/tests/test_utils_args_types.py +++ b/tests/test_utils_args_types.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_utils_check_path.py b/tests/test_utils_check_path.py index 0bf7fb8..c6df744 100644 --- a/tests/test_utils_check_path.py +++ b/tests/test_utils_check_path.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_utils_date_helpers.py b/tests/test_utils_date_helpers.py index 46aec01..2311e3f 100644 --- a/tests/test_utils_date_helpers.py +++ b/tests/test_utils_date_helpers.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_utils_file_stats.py b/tests/test_utils_file_stats.py index 65ce7e0..a9169d5 100644 --- a/tests/test_utils_file_stats.py +++ b/tests/test_utils_file_stats.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_utils_formatters.py b/tests/test_utils_formatters.py index 4d3a699..46bc7bc 100644 --- a/tests/test_utils_formatters.py +++ b/tests/test_utils_formatters.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_utils_images_size.py b/tests/test_utils_images_size.py index 8bc6c40..ec88d5c 100644 --- a/tests/test_utils_images_size.py +++ b/tests/test_utils_images_size.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_utils_proxies.py b/tests/test_utils_proxies.py index 42657ce..1a9cc2e 100644 --- a/tests/test_utils_proxies.py +++ b/tests/test_utils_proxies.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_utils_slugifier.py b/tests/test_utils_slugifier.py index 76ea183..8bd4840 100644 --- a/tests/test_utils_slugifier.py +++ b/tests/test_utils_slugifier.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: diff --git a/tests/test_utils_str2bool.py b/tests/test_utils_str2bool.py index 9f60fab..d138613 100644 --- a/tests/test_utils_str2bool.py +++ b/tests/test_utils_str2bool.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: @@ -34,8 +34,8 @@ def test_str2bool(self): # KO with self.assertRaises(TypeError): - str2bool(input_var=int(10), raise_exc=True) - self.assertIsNone(str2bool(input_var=int(10), raise_exc=False)) + str2bool(input_var=10, raise_exc=True) + self.assertIsNone(str2bool(input_var=10, raise_exc=False)) with self.assertRaises(ValueError): str2bool(input_var="vrai", raise_exc=True) diff --git a/tests/test_utils_url_helpers.py b/tests/test_utils_url_helpers.py index 396dac3..44b7449 100644 --- a/tests/test_utils_url_helpers.py +++ b/tests/test_utils_url_helpers.py @@ -1,4 +1,4 @@ -#! python3 # noqa E265 +#! python3 """ Usage from the repo root folder: