From cfaef7c2e3d01f8e7fd43884510157fa51eea99b Mon Sep 17 00:00:00 2001 From: samuel-w Date: Wed, 23 Sep 2020 21:42:42 -0500 Subject: [PATCH 1/4] Give unmount failure message --- src/vorta/views/archive_tab.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/vorta/views/archive_tab.py b/src/vorta/views/archive_tab.py index 8271544ef..c5a327657 100644 --- a/src/vorta/views/archive_tab.py +++ b/src/vorta/views/archive_tab.py @@ -299,14 +299,17 @@ def umount_action(self): def umount_result(self, result): self._toggle_all_buttons(True) + archive_name = result['params']['current_archive'] if result['returncode'] == 0: - self._set_status(self.tr('Un-mounted successfully.')) - archive_name = result['params']['current_archive'] + self._set_status(self.tr('Unmounted successfully.')) del self.mount_points[archive_name] self.update_mount_button_text() row = self.row_of_archive(archive_name) item = QTableWidgetItem('') self.archiveTable.setItem(row, 3, item) + else: + self._set_status(self.tr('Unmounting failed. Make sure no programs are using {}').format( + self.mount_points.get(archive_name))) def save_prune_setting(self, new_value=None): profile = self.profile() From 849e951cc3b3a8a8948efd7dc14de34dec2e3b03 Mon Sep 17 00:00:00 2001 From: samuel-w Date: Wed, 23 Sep 2020 21:45:54 -0500 Subject: [PATCH 2/4] Fix test --- tests/test_archives.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_archives.py b/tests/test_archives.py index a5303e6b3..1f0b91ebf 100644 --- a/tests/test_archives.py +++ b/tests/test_archives.py @@ -105,7 +105,7 @@ def psutil_disk_partitions(**kwargs): qtbot.waitUntil(lambda: tab.mountErrors.text().startswith('Mounted'), timeout=10000) qtbot.mouseClick(tab.mountButton, QtCore.Qt.LeftButton) - qtbot.waitUntil(lambda: tab.mountErrors.text().startswith('Un-mounted successfully.'), timeout=10000) + qtbot.waitUntil(lambda: tab.mountErrors.text().startswith('Unmounted successfully.'), timeout=10000) def test_archive_extract(qapp, qtbot, mocker, borg_json_output, monkeypatch): From 91075d8dd42cf80c5222bfbb6dcbc0038f4bf17a Mon Sep 17 00:00:00 2001 From: samuel-w Date: Wed, 23 Sep 2020 21:56:49 -0500 Subject: [PATCH 3/4] Use fstring --- src/vorta/views/archive_tab.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vorta/views/archive_tab.py b/src/vorta/views/archive_tab.py index c5a327657..2a0ed09ba 100644 --- a/src/vorta/views/archive_tab.py +++ b/src/vorta/views/archive_tab.py @@ -308,8 +308,8 @@ def umount_result(self, result): item = QTableWidgetItem('') self.archiveTable.setItem(row, 3, item) else: - self._set_status(self.tr('Unmounting failed. Make sure no programs are using {}').format( - self.mount_points.get(archive_name))) + self._set_status( + self.tr(f'Unmounting failed. Make sure no programs are using {self.mount_points.get(archive_name)}')) def save_prune_setting(self, new_value=None): profile = self.profile() From c7d1723bcfa1be497f2fb75e307a459b64676532 Mon Sep 17 00:00:00 2001 From: samuel-w Date: Sun, 27 Sep 2020 03:17:22 -0500 Subject: [PATCH 4/4] Revert changes as requested --- src/vorta/views/archive_tab.py | 6 +++--- tests/test_archives.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vorta/views/archive_tab.py b/src/vorta/views/archive_tab.py index 2a0ed09ba..bd10790d7 100644 --- a/src/vorta/views/archive_tab.py +++ b/src/vorta/views/archive_tab.py @@ -301,15 +301,15 @@ def umount_result(self, result): self._toggle_all_buttons(True) archive_name = result['params']['current_archive'] if result['returncode'] == 0: - self._set_status(self.tr('Unmounted successfully.')) + self._set_status(self.tr('Un-mounted successfully.')) del self.mount_points[archive_name] self.update_mount_button_text() row = self.row_of_archive(archive_name) item = QTableWidgetItem('') self.archiveTable.setItem(row, 3, item) else: - self._set_status( - self.tr(f'Unmounting failed. Make sure no programs are using {self.mount_points.get(archive_name)}')) + self._set_status(self.tr('Unmounting failed. Make sure no programs are using {}').format( + self.mount_points.get(archive_name))) def save_prune_setting(self, new_value=None): profile = self.profile() diff --git a/tests/test_archives.py b/tests/test_archives.py index 1f0b91ebf..a5303e6b3 100644 --- a/tests/test_archives.py +++ b/tests/test_archives.py @@ -105,7 +105,7 @@ def psutil_disk_partitions(**kwargs): qtbot.waitUntil(lambda: tab.mountErrors.text().startswith('Mounted'), timeout=10000) qtbot.mouseClick(tab.mountButton, QtCore.Qt.LeftButton) - qtbot.waitUntil(lambda: tab.mountErrors.text().startswith('Unmounted successfully.'), timeout=10000) + qtbot.waitUntil(lambda: tab.mountErrors.text().startswith('Un-mounted successfully.'), timeout=10000) def test_archive_extract(qapp, qtbot, mocker, borg_json_output, monkeypatch):