From ed38012c6e43dac70a2c0eaf0ff02a368567b52a Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 9 Jul 2024 17:38:17 +0200 Subject: [PATCH 1/2] Code - Fixing deprecation warning (#2477) --- changedetectionio/blueprint/browser_steps/browser_steps.py | 5 +++-- changedetectionio/content_fetchers/base.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/changedetectionio/blueprint/browser_steps/browser_steps.py b/changedetectionio/blueprint/browser_steps/browser_steps.py index ea7c099f..292d7a8a 100644 --- a/changedetectionio/blueprint/browser_steps/browser_steps.py +++ b/changedetectionio/blueprint/browser_steps/browser_steps.py @@ -256,7 +256,8 @@ class browsersteps_live_ui(steppable_browser_interface): def get_current_state(self): """Return the screenshot and interactive elements mapping, generally always called after action_()""" import importlib.resources - xpath_element_js = importlib.resources.read_text("changedetectionio.content_fetchers.res", "xpath_element_scraper.js") + xpath_element_js = importlib.resources.files("changedetectionio.content_fetchers.res").joinpath('xpath_element_scraper.js').read_text() + now = time.time() self.page.wait_for_timeout(1 * 1000) @@ -289,7 +290,7 @@ class browsersteps_live_ui(steppable_browser_interface): """ import importlib.resources self.page.evaluate("var include_filters=''") - xpath_element_js = importlib.resources.read_text("changedetectionio.content_fetchers.res", "xpath_element_scraper.js") + xpath_element_js = importlib.resources.files("changedetectionio.content_fetchers.res").joinpath('xpath_element_scraper.js').read_text() from changedetectionio.content_fetchers import visualselector_xpath_selectors xpath_element_js = xpath_element_js.replace('%ELEMENTS%', visualselector_xpath_selectors) xpath_data = self.page.evaluate("async () => {" + xpath_element_js + "}") diff --git a/changedetectionio/content_fetchers/base.py b/changedetectionio/content_fetchers/base.py index 136fe9e5..eb95f04a 100644 --- a/changedetectionio/content_fetchers/base.py +++ b/changedetectionio/content_fetchers/base.py @@ -65,8 +65,8 @@ class Fetcher(): def __init__(self): import importlib.resources - self.xpath_element_js = importlib.resources.read_text("changedetectionio.content_fetchers.res", 'xpath_element_scraper.js') - self.instock_data_js = importlib.resources.read_text("changedetectionio.content_fetchers.res", 'stock-not-in-stock.js') + self.xpath_element_js = importlib.resources.files("changedetectionio.content_fetchers.res").joinpath('xpath_element_scraper.js').read_text() + self.instock_data_js = importlib.resources.files("changedetectionio.content_fetchers.res").joinpath('stock-not-in-stock.js').read_text() @abstractmethod def get_error(self): From 5437144dff1f564eb317d9e94da1f2ec90db19d5 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Thu, 11 Jul 2024 13:52:13 +0200 Subject: [PATCH 2/2] 0.45.26 --- changedetectionio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index 86f26da9..86d4c08e 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -2,7 +2,7 @@ # Read more https://github.com/dgtlmoon/changedetection.io/wiki -__version__ = '0.45.25' +__version__ = '0.45.26' from changedetectionio.strtobool import strtobool from json.decoder import JSONDecodeError