From 09e9ed387874b9b3681bdb0e05b2b80fee9f9955 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Wed, 14 Oct 2020 20:25:49 -0700 Subject: PySide2 datetimes use .toPython instead of .toPyDateTime --- desktop/src/onionshare/tab/server_status.py | 12 ++++++------ 1 file 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 -- cgit v1.2.3-54-g00ecf