mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2025-11-02 15:47:19 +00:00
Some tidyup
Some checks are pending
Publish Python 🐍distribution 📦 to PyPI and TestPyPI / Build distribution 📦 (push) Waiting to run
Publish Python 🐍distribution 📦 to PyPI and TestPyPI / Test the built 📦 package works basically. (push) Blocked by required conditions
Publish Python 🐍distribution 📦 to PyPI and TestPyPI / Publish Python 🐍 distribution 📦 to PyPI (push) Blocked by required conditions
ChangeDetection.io App Test / lint-code (push) Waiting to run
ChangeDetection.io App Test / test-application-3-10 (push) Blocked by required conditions
ChangeDetection.io App Test / test-application-3-11 (push) Blocked by required conditions
ChangeDetection.io App Test / test-application-3-12 (push) Blocked by required conditions
ChangeDetection.io App Test / test-application-3-13 (push) Blocked by required conditions
Some checks are pending
Publish Python 🐍distribution 📦 to PyPI and TestPyPI / Build distribution 📦 (push) Waiting to run
Publish Python 🐍distribution 📦 to PyPI and TestPyPI / Test the built 📦 package works basically. (push) Blocked by required conditions
Publish Python 🐍distribution 📦 to PyPI and TestPyPI / Publish Python 🐍 distribution 📦 to PyPI (push) Blocked by required conditions
ChangeDetection.io App Test / lint-code (push) Waiting to run
ChangeDetection.io App Test / test-application-3-10 (push) Blocked by required conditions
ChangeDetection.io App Test / test-application-3-11 (push) Blocked by required conditions
ChangeDetection.io App Test / test-application-3-12 (push) Blocked by required conditions
ChangeDetection.io App Test / test-application-3-13 (push) Blocked by required conditions
This commit is contained in:
@@ -13,13 +13,9 @@ def register_operators():
|
||||
def ends_with(_, text, suffix):
|
||||
return text.lower().strip().endswith(suffix.lower())
|
||||
|
||||
def extracted_number(_, text, suffix):
|
||||
return 1
|
||||
|
||||
return {
|
||||
"starts_with": starts_with,
|
||||
"ends_with": ends_with,
|
||||
"extracted_number": extracted_number
|
||||
"ends_with": ends_with
|
||||
}
|
||||
|
||||
@hookimpl
|
||||
@@ -42,7 +38,6 @@ def register_field_choices():
|
||||
@hookimpl
|
||||
def add_data(current_watch_uuid, application_datastruct, ephemeral_data):
|
||||
|
||||
|
||||
res = {}
|
||||
if 'text' in ephemeral_data:
|
||||
res['page_text'] = ephemeral_data['text']
|
||||
@@ -53,5 +48,4 @@ def add_data(current_watch_uuid, application_datastruct, ephemeral_data):
|
||||
res['extracted_number'] = float(price.amount)
|
||||
logger.debug(f"Extracted price result: '{price}' - returning float({res['extracted_number']})")
|
||||
|
||||
|
||||
return res
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
from changedetectionio.conditions import execute_ruleset_against_all_plugins
|
||||
from changedetectionio.model import Watch
|
||||
from changedetectionio.store import ChangeDetectionStore
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import tempfile
|
||||
import time
|
||||
import time
|
||||
import unittest
|
||||
import unittest
|
||||
import uuid
|
||||
|
||||
@@ -69,6 +64,7 @@ class TestTriggerConditions(unittest.TestCase):
|
||||
{"operator": ">=", "field": "extracted_number", "value": "10"},
|
||||
{"operator": "<=", "field": "extracted_number", "value": "5000"},
|
||||
{"operator": "in", "field": "page_text", "value": "rock"},
|
||||
#{"operator": "starts_with", "field": "page_text", "value": "I saw"},
|
||||
]
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user