1717
1818import requests
1919
20- from src .clicksend_sms_notifier import ClickSendSMSNotifier as SMSNotifier
21- from src .clicksend_sms_notifier import create_notifier_from_env
20+ try :
21+ from src .clicksend_sms_notifier import ClickSendSMSNotifier as SMSNotifier
22+ from src .clicksend_sms_notifier import create_notifier_from_env
23+ except ImportError :
24+ from clicksend_sms_notifier import ClickSendSMSNotifier as SMSNotifier
25+ from clicksend_sms_notifier import create_notifier_from_env
2226
2327
2428class URLWatcher :
@@ -42,7 +46,8 @@ def _save_cache(self):
4246 with open (self .storage_file , "w" ) as f :
4347 json .dump (self .cache , f , indent = 2 )
4448
45- def _fetch_url_content (self , url ):
49+ @staticmethod
50+ def _fetch_url_content (url ):
4651 """Fetch content from URL"""
4752 try :
4853 response = requests .get (url , timeout = 10 )
@@ -51,7 +56,8 @@ def _fetch_url_content(self, url):
5156 except requests .RequestException as e :
5257 raise Exception (f"Failed to fetch URL: { e } " )
5358
54- def _get_content_hash (self , content ):
59+ @staticmethod
60+ def _get_content_hash (content ):
5561 """Generate hash of content for quick comparison"""
5662 return hashlib .sha256 (content .encode ("utf-8" )).hexdigest ()
5763
@@ -114,7 +120,8 @@ def check_url(self, url):
114120
115121 return True , diff
116122
117- def _generate_diff (self , old_content , new_content , url ):
123+ @staticmethod
124+ def _generate_diff (old_content , new_content , url ):
118125 """Generate human-readable difference between old and new content"""
119126 old_lines = old_content .splitlines (keepends = True )
120127 new_lines = new_content .splitlines (keepends = True )
0 commit comments