2023-03-18 19:36:26 +00:00
|
|
|
from abc import abstractmethod
|
|
|
|
import hashlib
|
|
|
|
|
|
|
|
|
|
|
|
class difference_detection_processor():
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
|
|
|
@abstractmethod
|
2023-07-10 14:08:45 +00:00
|
|
|
def run(self, uuid, skip_when_checksum_same=True, preferred_proxy=None):
|
2023-03-18 19:36:26 +00:00
|
|
|
update_obj = {'last_notification_error': False, 'last_error': False}
|
|
|
|
some_data = 'xxxxx'
|
|
|
|
update_obj["previous_md5"] = hashlib.md5(some_data.encode('utf-8')).hexdigest()
|
|
|
|
changed_detected = False
|
|
|
|
return changed_detected, update_obj, ''.encode('utf-8')
|
|
|
|
|
|
|
|
|
|
|
|
def available_processors():
|
|
|
|
from . import restock_diff, text_json_diff
|
|
|
|
x=[('text_json_diff', text_json_diff.name), ('restock_diff', restock_diff.name)]
|
|
|
|
# @todo Make this smarter with introspection of sorts.
|
|
|
|
return x
|