mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2025-12-12 11:05:42 +00:00
Code - Remove unused f-strings (#3209)
This commit is contained in:
@@ -89,7 +89,7 @@ class difference_detection_processor():
|
|||||||
proxy_url = self.datastore.proxy_list.get(preferred_proxy_id).get('url')
|
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}")
|
logger.debug(f"Selected proxy key '{preferred_proxy_id}' as proxy URL '{proxy_url}' for {url}")
|
||||||
else:
|
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.
|
# 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)
|
# When browser_connection_url is None, it method should default to working out whats the best defaults (os env vars etc)
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ def get_itemprop_availability(html_content) -> Restock:
|
|||||||
# First phase, dead simple scanning of anything that looks useful
|
# First phase, dead simple scanning of anything that looks useful
|
||||||
value = Restock()
|
value = Restock()
|
||||||
if data:
|
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)')
|
price_parse = parse('$..(price|Price)')
|
||||||
pricecurrency_parse = parse('$..(pricecurrency|currency|priceCurrency )')
|
pricecurrency_parse = parse('$..(pricecurrency|currency|priceCurrency )')
|
||||||
availability_parse = parse('$..(availability|Availability)')
|
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 (:)
|
# 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'):
|
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')
|
jsonpath_expr = parse('$..properties')
|
||||||
|
|
||||||
for match in jsonpath_expr.find(data):
|
for match in jsonpath_expr.find(data):
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ def _task(watch, update_handler):
|
|||||||
except FilterNotFoundInResponse as e:
|
except FilterNotFoundInResponse as e:
|
||||||
text_after_filter = f"Filter not found in HTML: {str(e)}"
|
text_after_filter = f"Filter not found in HTML: {str(e)}"
|
||||||
except ReplyWithContentButNoText as 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:
|
except Exception as e:
|
||||||
text_after_filter = f"Error: {str(e)}"
|
text_after_filter = f"Error: {str(e)}"
|
||||||
|
|
||||||
|
|||||||
@@ -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):
|
def do_test(client, live_server, make_test_use_extra_browser=False):
|
||||||
|
|
||||||
# Grep for this string in the logs?
|
# 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
|
# "non-custom-default" should not appear in the custom browser connection
|
||||||
custom_browser_name = 'custom browser URL'
|
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"),
|
url_for("ui.ui_edit.edit_page", uuid="first"),
|
||||||
data={
|
data={
|
||||||
# 'run_customer_browser_url_tests.sh' will search for this string to know if we hit the right browser container or not
|
# '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": "",
|
"tags": "",
|
||||||
"headers": "",
|
"headers": "",
|
||||||
'fetch_backend': f"extra_browser_{custom_browser_name}",
|
'fetch_backend': f"extra_browser_{custom_browser_name}",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from changedetectionio.tests.util import live_server_setup, wait_for_all_checks,
|
|||||||
|
|
||||||
def set_response():
|
def set_response():
|
||||||
import time
|
import time
|
||||||
data = f"""<html>
|
data = """<html>
|
||||||
<body>
|
<body>
|
||||||
<h1>Awesome, you made it</h1>
|
<h1>Awesome, you made it</h1>
|
||||||
yeah the socks request worked
|
yeah the socks request worked
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from changedetectionio.tests.util import live_server_setup, wait_for_all_checks
|
|||||||
|
|
||||||
def set_response():
|
def set_response():
|
||||||
import time
|
import time
|
||||||
data = f"""<html>
|
data = """<html>
|
||||||
<body>
|
<body>
|
||||||
<h1>Awesome, you made it</h1>
|
<h1>Awesome, you made it</h1>
|
||||||
yeah the socks request worked
|
yeah the socks request worked
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from changedetectionio.tests.util import live_server_setup, wait_for_all_checks,
|
|||||||
|
|
||||||
def set_response():
|
def set_response():
|
||||||
|
|
||||||
data = f"""<html>
|
data = """<html>
|
||||||
<body>Awesome, you made it<br>
|
<body>Awesome, you made it<br>
|
||||||
yeah the socks request worked<br>
|
yeah the socks request worked<br>
|
||||||
something to ignore<br>
|
something to ignore<br>
|
||||||
|
|||||||
Reference in New Issue
Block a user