Skip to content

Commit

Permalink
Revert "Convert off of ClassMethods."
Browse files Browse the repository at this point in the history
This reverts commit 95ba1d1.
  • Loading branch information
SmokeDetector committed Dec 28, 2016
1 parent d867c6f commit 42c8275
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions deletionwatcher.py
Expand Up @@ -11,8 +11,8 @@

# noinspection PyClassHasNoInit,PyBroadException
class DeletionWatcher:
@staticmethod
def update_site_id_list():
@classmethod
def update_site_id_list(self):
soup = BeautifulSoup(requests.get("http://meta.stackexchange.com/topbar/site-switcher/site-list").text)
site_id_dict = {}
for site in soup.findAll("a", attrs={"data-id": True}):
Expand All @@ -21,8 +21,8 @@ def update_site_id_list():
site_id_dict[site_name] = site_id
GlobalVars.site_id_dict = site_id_dict

@staticmethod
def check_websocket_for_deletion(post_site_id, post_url, timeout):
@classmethod
def check_websocket_for_deletion(self, post_site_id, post_url, timeout):
time_to_check = time.time() + timeout
post_id = post_site_id[0]
post_type = post_site_id[2]
Expand Down Expand Up @@ -69,6 +69,7 @@ def check_websocket_for_deletion(post_site_id, post_url, timeout):
t_metasmoke.start()
return False

@classmethod
def check_if_report_was_deleted(self, post_site_id, post_url, message):
was_report_deleted = self.check_websocket_for_deletion(post_site_id, post_url, 1200)
if was_report_deleted:
Expand All @@ -77,6 +78,7 @@ def check_if_report_was_deleted(self, post_site_id, post_url, message):
except:
pass

@classmethod
def post_message_if_not_deleted(self, post_site_id, post_url, message_text, room):
was_report_deleted = self.check_websocket_for_deletion(post_site_id, post_url, 300)
if not was_report_deleted and not datahandling.is_false_positive(post_site_id[0:2]) and not datahandling.is_ignored_post(post_site_id[0:2]):
Expand Down

0 comments on commit 42c8275

Please sign in to comment.