mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2025-11-08 10:36:32 +00:00
Compare commits
5 Commits
windows-mi
...
2554-colou
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd7f83efb4 | ||
|
|
2fb072c658 | ||
|
|
69c3d5a3fb | ||
|
|
d88da3cd88 | ||
|
|
c275be9493 |
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Read more https://github.com/dgtlmoon/changedetection.io/wiki
|
# Read more https://github.com/dgtlmoon/changedetection.io/wiki
|
||||||
|
|
||||||
__version__ = '0.48.03'
|
__version__ = '0.48.01'
|
||||||
|
|
||||||
from changedetectionio.strtobool import strtobool
|
from changedetectionio.strtobool import strtobool
|
||||||
from json.decoder import JSONDecodeError
|
from json.decoder import JSONDecodeError
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ valid_tokens = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
default_notification_format_for_watch = 'System default'
|
default_notification_format_for_watch = 'System default'
|
||||||
default_notification_format = 'HTML Color'
|
default_notification_format = 'Text'
|
||||||
default_notification_body = '{{watch_url}} had a change.\n---\n{{diff}}\n---\n'
|
default_notification_body = '{{watch_url}} had a change.\n---\n{{diff}}\n---\n'
|
||||||
default_notification_title = 'ChangeDetection.io Notification - {{watch_url}}'
|
default_notification_title = 'ChangeDetection.io Notification - {{watch_url}}'
|
||||||
|
|
||||||
|
|||||||
@@ -113,8 +113,7 @@ def test_check_add_line_contains_trigger(client, live_server, measure_memory_usa
|
|||||||
res = client.post(
|
res = client.post(
|
||||||
url_for("settings_page"),
|
url_for("settings_page"),
|
||||||
data={"application-notification_title": "New ChangeDetection.io Notification - {{ watch_url }}",
|
data={"application-notification_title": "New ChangeDetection.io Notification - {{ watch_url }}",
|
||||||
# triggered_text will contain multiple lines
|
"application-notification_body": 'triggered text was -{{triggered_text}}- 网站监测 内容更新了',
|
||||||
"application-notification_body": 'triggered text was -{{triggered_text}}- ### 网站监测 内容更新了 ####',
|
|
||||||
# https://github.com/caronc/apprise/wiki/Notify_Custom_JSON#get-parameter-manipulation
|
# https://github.com/caronc/apprise/wiki/Notify_Custom_JSON#get-parameter-manipulation
|
||||||
"application-notification_urls": test_notification_url,
|
"application-notification_urls": test_notification_url,
|
||||||
"application-minutes_between_check": 180,
|
"application-minutes_between_check": 180,
|
||||||
@@ -172,7 +171,7 @@ def test_check_add_line_contains_trigger(client, live_server, measure_memory_usa
|
|||||||
assert os.path.isfile("test-datastore/notification.txt"), "Notification fired because I can see the output file"
|
assert os.path.isfile("test-datastore/notification.txt"), "Notification fired because I can see the output file"
|
||||||
with open("test-datastore/notification.txt", 'rb') as f:
|
with open("test-datastore/notification.txt", 'rb') as f:
|
||||||
response = f.read()
|
response = f.read()
|
||||||
assert b'-Oh yes please' in response
|
assert b'-Oh yes please-' in response
|
||||||
assert '网站监测 内容更新了'.encode('utf-8') in response
|
assert '网站监测 内容更新了'.encode('utf-8') in response
|
||||||
|
|
||||||
res = client.get(url_for("form_delete", uuid="all"), follow_redirects=True)
|
res = client.get(url_for("form_delete", uuid="all"), follow_redirects=True)
|
||||||
|
|||||||
@@ -502,7 +502,7 @@ def _test_color_notifications(client, notification_body_token):
|
|||||||
|
|
||||||
def test_html_color_notifications(client, live_server, measure_memory_usage):
|
def test_html_color_notifications(client, live_server, measure_memory_usage):
|
||||||
|
|
||||||
#live_server_setup(live_server)
|
live_server_setup(live_server)
|
||||||
_test_color_notifications(client, '{{diff}}')
|
_test_color_notifications(client, '{{diff}}')
|
||||||
_test_color_notifications(client, '{{diff_full}}')
|
_test_color_notifications(client, '{{diff_full}}')
|
||||||
|
|
||||||
@@ -28,8 +28,6 @@ class update_worker(threading.Thread):
|
|||||||
|
|
||||||
def queue_notification_for_watch(self, notification_q, n_object, watch):
|
def queue_notification_for_watch(self, notification_q, n_object, watch):
|
||||||
from changedetectionio import diff
|
from changedetectionio import diff
|
||||||
from changedetectionio.notification import default_notification_format_for_watch
|
|
||||||
|
|
||||||
dates = []
|
dates = []
|
||||||
trigger_text = ''
|
trigger_text = ''
|
||||||
|
|
||||||
@@ -46,10 +44,6 @@ class update_worker(threading.Thread):
|
|||||||
else:
|
else:
|
||||||
snapshot_contents = "No snapshot/history available, the watch should fetch atleast once."
|
snapshot_contents = "No snapshot/history available, the watch should fetch atleast once."
|
||||||
|
|
||||||
# If we ended up here with "System default"
|
|
||||||
if n_object.get('notification_format') == default_notification_format_for_watch:
|
|
||||||
n_object['notification_format'] = self.datastore.data['settings']['application'].get('notification_format')
|
|
||||||
|
|
||||||
html_colour_enable = False
|
html_colour_enable = False
|
||||||
# HTML needs linebreak, but MarkDown and Text can use a linefeed
|
# HTML needs linebreak, but MarkDown and Text can use a linefeed
|
||||||
if n_object.get('notification_format') == 'HTML':
|
if n_object.get('notification_format') == 'HTML':
|
||||||
|
|||||||
@@ -95,5 +95,3 @@ babel
|
|||||||
# Needed for > 3.10, https://github.com/microsoft/playwright-python/issues/2096
|
# Needed for > 3.10, https://github.com/microsoft/playwright-python/issues/2096
|
||||||
greenlet >= 3.0.3
|
greenlet >= 3.0.3
|
||||||
|
|
||||||
# Scheduler - Windows seemed to miss a lot of default timezone info (even "UTC" !)
|
|
||||||
tzdata
|
|
||||||
|
|||||||
Reference in New Issue
Block a user