From 9b7372fff047e6a4d9f0c7c585ec7c8257ec937c Mon Sep 17 00:00:00 2001 From: Jost Alemann <58050402+ddogfoodd@users.noreply.github.com> Date: Thu, 22 May 2025 10:11:39 +0000 Subject: [PATCH] Code - Remove unused f-strings (#3209) --- changedetectionio/processors/__init__.py | 2 +- changedetectionio/processors/restock_diff/processor.py | 4 ++-- changedetectionio/processors/text_json_diff/__init__.py | 2 +- .../tests/custom_browser_url/test_custom_browser_url.py | 4 ++-- changedetectionio/tests/proxy_socks5/test_socks5_proxy.py | 2 +- .../tests/proxy_socks5/test_socks5_proxy_sources.py | 2 +- changedetectionio/tests/test_live_preview.py | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/changedetectionio/processors/__init__.py b/changedetectionio/processors/__init__.py index 1dd703ba..e7c97a16 100644 --- a/changedetectionio/processors/__init__.py +++ b/changedetectionio/processors/__init__.py @@ -89,7 +89,7 @@ class difference_detection_processor(): proxy_url = self.datastore.proxy_list.get(preferred_proxy_id).get('url') logger.debug(f"Selected proxy key '{preferred_proxy_id}' as proxy URL '{proxy_url}' for {url}") else: - logger.debug(f"Skipping adding proxy data when custom Browser endpoint is specified. ") + logger.debug("Skipping adding proxy data when custom Browser endpoint is specified. ") # Now call the fetcher (playwright/requests/etc) with arguments that only a fetcher would need. # When browser_connection_url is None, it method should default to working out whats the best defaults (os env vars etc) diff --git a/changedetectionio/processors/restock_diff/processor.py b/changedetectionio/processors/restock_diff/processor.py index ac351210..7bff4b31 100644 --- a/changedetectionio/processors/restock_diff/processor.py +++ b/changedetectionio/processors/restock_diff/processor.py @@ -79,7 +79,7 @@ def get_itemprop_availability(html_content) -> Restock: # First phase, dead simple scanning of anything that looks useful value = Restock() if data: - logger.debug(f"Using jsonpath to find price/availability/etc") + logger.debug("Using jsonpath to find price/availability/etc") price_parse = parse('$..(price|Price)') pricecurrency_parse = parse('$..(pricecurrency|currency|priceCurrency )') availability_parse = parse('$..(availability|Availability)') @@ -110,7 +110,7 @@ def get_itemprop_availability(html_content) -> Restock: # Second, go dig OpenGraph which is something that jsonpath_ng cant do because of the tuples and double-dots (:) if not value.get('price') or value.get('availability'): - logger.debug(f"Alternatively digging through OpenGraph properties for restock/price info..") + logger.debug("Alternatively digging through OpenGraph properties for restock/price info..") jsonpath_expr = parse('$..properties') for match in jsonpath_expr.find(data): diff --git a/changedetectionio/processors/text_json_diff/__init__.py b/changedetectionio/processors/text_json_diff/__init__.py index 8e5bdfc8..14053374 100644 --- a/changedetectionio/processors/text_json_diff/__init__.py +++ b/changedetectionio/processors/text_json_diff/__init__.py @@ -15,7 +15,7 @@ def _task(watch, update_handler): except FilterNotFoundInResponse as e: text_after_filter = f"Filter not found in HTML: {str(e)}" except ReplyWithContentButNoText as e: - text_after_filter = f"Filter found but no text (empty result)" + text_after_filter = "Filter found but no text (empty result)" except Exception as e: text_after_filter = f"Error: {str(e)}" diff --git a/changedetectionio/tests/custom_browser_url/test_custom_browser_url.py b/changedetectionio/tests/custom_browser_url/test_custom_browser_url.py index 5f4cf858..efc6e127 100644 --- a/changedetectionio/tests/custom_browser_url/test_custom_browser_url.py +++ b/changedetectionio/tests/custom_browser_url/test_custom_browser_url.py @@ -7,7 +7,7 @@ from ..util import live_server_setup, wait_for_all_checks def do_test(client, live_server, make_test_use_extra_browser=False): # Grep for this string in the logs? - test_url = f"https://changedetection.io/ci-test.html?non-custom-default=true" + test_url = "https://changedetection.io/ci-test.html?non-custom-default=true" # "non-custom-default" should not appear in the custom browser connection custom_browser_name = 'custom browser URL' @@ -51,7 +51,7 @@ def do_test(client, live_server, make_test_use_extra_browser=False): url_for("ui.ui_edit.edit_page", uuid="first"), data={ # 'run_customer_browser_url_tests.sh' will search for this string to know if we hit the right browser container or not - "url": f"https://changedetection.io/ci-test.html?custom-browser-search-string=1", + "url": "https://changedetection.io/ci-test.html?custom-browser-search-string=1", "tags": "", "headers": "", 'fetch_backend': f"extra_browser_{custom_browser_name}", diff --git a/changedetectionio/tests/proxy_socks5/test_socks5_proxy.py b/changedetectionio/tests/proxy_socks5/test_socks5_proxy.py index 6119447d..3d0271a8 100644 --- a/changedetectionio/tests/proxy_socks5/test_socks5_proxy.py +++ b/changedetectionio/tests/proxy_socks5/test_socks5_proxy.py @@ -7,7 +7,7 @@ from changedetectionio.tests.util import live_server_setup, wait_for_all_checks, def set_response(): import time - data = f""" + data = """