diff options
author | Micah Lee <micah@micahflee.com> | 2020-10-14 20:25:49 -0700 |
---|---|---|
committer | Micah Lee <micah@micahflee.com> | 2020-10-14 20:25:49 -0700 |
commit | 09e9ed387874b9b3681bdb0e05b2b80fee9f9955 (patch) | |
tree | 778598a65602d70f966e85edcff3f113d665206e | |
parent | 79100f050c216f03301d34529c2f6bc618e06304 (diff) | |
download | onionshare-09e9ed387874b9b3681bdb0e05b2b80fee9f9955.tar.gz onionshare-09e9ed387874b9b3681bdb0e05b2b80fee9f9955.zip |
PySide2 datetimes use .toPython instead of .toPyDateTime
-rw-r--r-- | desktop/src/onionshare/tab/server_status.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/desktop/src/onionshare/tab/server_status.py b/desktop/src/onionshare/tab/server_status.py index a1041c92..29c72300 100644 --- a/desktop/src/onionshare/tab/server_status.py +++ b/desktop/src/onionshare/tab/server_status.py @@ -324,17 +324,17 @@ class ServerStatus(QtWidgets.QWidget): if self.settings.get("general", "autostart_timer"): if self.local_only: self.autostart_timer_datetime = ( - self.mode_settings_widget.autostart_timer_widget.dateTime().toPyDateTime() + self.mode_settings_widget.autostart_timer_widget.dateTime().toPython() ) else: self.autostart_timer_datetime = ( self.mode_settings_widget.autostart_timer_widget.dateTime() - .toPyDateTime() + .toPython() .replace(second=0, microsecond=0) ) # If the timer has actually passed already before the user hit Start, refuse to start the server. if ( - QtCore.QDateTime.currentDateTime().toPyDateTime() + QtCore.QDateTime.currentDateTime().toPython() > self.autostart_timer_datetime ): can_start = False @@ -346,18 +346,18 @@ class ServerStatus(QtWidgets.QWidget): if self.settings.get("general", "autostop_timer"): if self.local_only: self.autostop_timer_datetime = ( - self.mode_settings_widget.autostop_timer_widget.dateTime().toPyDateTime() + self.mode_settings_widget.autostop_timer_widget.dateTime().toPython() ) else: # Get the timer chosen, stripped of its seconds. This prevents confusion if the share stops at (say) 37 seconds past the minute chosen self.autostop_timer_datetime = ( self.mode_settings_widget.autostop_timer_widget.dateTime() - .toPyDateTime() + .toPython() .replace(second=0, microsecond=0) ) # If the timer has actually passed already before the user hit Start, refuse to start the server. if ( - QtCore.QDateTime.currentDateTime().toPyDateTime() + QtCore.QDateTime.currentDateTime().toPython() > self.autostop_timer_datetime ): can_start = False |