From 4ee6647ee5e638db1f0dc9245edaa0f9b7d80ed7 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Tue, 3 Sep 2019 22:20:52 -0700 Subject: [PATCH] Rename a few more count variables to cur_history_id --- onionshare/__init__.py | 4 ++-- onionshare_gui/mode/receive_mode/__init__.py | 4 ++-- onionshare_gui/mode/share_mode/__init__.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/onionshare/__init__.py b/onionshare/__init__.py index 0003106f..7e7798f8 100644 --- a/onionshare/__init__.py +++ b/onionshare/__init__.py @@ -262,12 +262,12 @@ def main(cwd=None): if not app.autostop_timer_thread.is_alive(): if mode == 'share' or (mode == 'website'): # If there were no attempts to download the share, or all downloads are done, we can stop - if web.share_mode.download_count == 0 or web.done: + if web.share_mode.cur_history_id == 0 or web.done: print("Stopped because auto-stop timer ran out") web.stop(app.port) break if mode == 'receive': - if web.receive_mode.upload_count == 0 or not web.receive_mode.uploads_in_progress: + if web.receive_mode.cur_history_id == 0 or not web.receive_mode.uploads_in_progress: print("Stopped because auto-stop timer ran out") web.stop(app.port) break diff --git a/onionshare_gui/mode/receive_mode/__init__.py b/onionshare_gui/mode/receive_mode/__init__.py index 0010fbd2..ecbfa54a 100644 --- a/onionshare_gui/mode/receive_mode/__init__.py +++ b/onionshare_gui/mode/receive_mode/__init__.py @@ -97,7 +97,7 @@ class ReceiveMode(Mode): The auto-stop timer expired, should we stop the server? Returns a bool """ # If there were no attempts to upload files, or all uploads are done, we can stop - if self.web.receive_mode.upload_count == 0 or not self.web.receive_mode.uploads_in_progress: + if self.web.receive_mode.cur_history_id == 0 or not self.web.receive_mode.uploads_in_progress: self.server_status.stop_server() self.server_status_label.setText(strings._('close_on_autostop_timer')) return True @@ -112,7 +112,7 @@ class ReceiveMode(Mode): Starting the server. """ # Reset web counters - self.web.receive_mode.upload_count = 0 + self.web.receive_mode.cur_history_id = 0 self.web.reset_invalid_passwords() # Hide and reset the uploads if we have previously shared diff --git a/onionshare_gui/mode/share_mode/__init__.py b/onionshare_gui/mode/share_mode/__init__.py index b5da0cd3..35a2045d 100644 --- a/onionshare_gui/mode/share_mode/__init__.py +++ b/onionshare_gui/mode/share_mode/__init__.py @@ -132,7 +132,7 @@ class ShareMode(Mode): The auto-stop timer expired, should we stop the server? Returns a bool """ # If there were no attempts to download the share, or all downloads are done, we can stop - if self.web.share_mode.download_count == 0 or self.web.done: + if self.web.share_mode.cur_history_id == 0 or self.web.done: self.server_status.stop_server() self.server_status_label.setText(strings._('close_on_autostop_timer')) return True @@ -146,7 +146,7 @@ class ShareMode(Mode): Starting the server. """ # Reset web counters - self.web.share_mode.download_count = 0 + self.web.share_mode.cur_history_id = 0 self.web.reset_invalid_passwords() # Hide and reset the downloads if we have previously shared