[manager] reordered methods

This commit is contained in:
Sam Schott 2021-03-21 15:22:21 +00:00
parent 1cdf7efe7f
commit 1c2a1c734d

View File

@ -309,29 +309,6 @@ class SyncMonitor:
self._logger.info(PAUSED) self._logger.info(PAUSED)
def connection_monitor(self) -> None:
"""
Monitors the connection to Dropbox servers. Pauses syncing when the connection
is lost and resumes syncing when reconnected and syncing has not been paused by
the user.
"""
while self._connection_helper_running:
connected = check_connection("www.dropbox.com")
if connected != self.connected:
# Log the status change.
self._logger.info(CONNECTED if connected else CONNECTING)
if connected:
if not self.running.is_set() and self.autostart.is_set():
self.start()
self.connected = connected
time.sleep(self.connection_check_interval)
def reset_sync_state(self) -> None: def reset_sync_state(self) -> None:
"""Resets all saved sync state. Settings are not affected.""" """Resets all saved sync state. Settings are not affected."""
@ -364,6 +341,29 @@ class SyncMonitor:
# ---- thread methods -------------------------------------------------------------- # ---- thread methods --------------------------------------------------------------
def connection_monitor(self) -> None:
"""
Monitors the connection to Dropbox servers. Pauses syncing when the connection
is lost and resumes syncing when reconnected and syncing has not been paused by
the user.
"""
while self._connection_helper_running:
connected = check_connection("www.dropbox.com")
if connected != self.connected:
# Log the status change.
self._logger.info(CONNECTED if connected else CONNECTING)
if connected:
if not self.running.is_set() and self.autostart.is_set():
self.start()
self.connected = connected
time.sleep(self.connection_check_interval)
def download_worker( def download_worker(
self, self,
running: Event, running: Event,