From 27099b8ea21fadc501b1751a23f3278c3dbfcb69 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 22 Sep 2025 16:55:04 -0500 Subject: [PATCH] PR feedback updates --- src/core/adb_manager.py | 12 +++--------- src/core/platform_tools.py | 5 ----- src/gui/components/file_browser.py | 4 +--- src/gui/main_window.py | 2 +- src/managers/transfer_manager.py | 13 ------------- tests/test_basic.py | 20 -------------------- 6 files changed, 5 insertions(+), 51 deletions(-) delete mode 100644 tests/test_basic.py diff --git a/src/core/adb_manager.py b/src/core/adb_manager.py index 0b9fad1..573f9dc 100644 --- a/src/core/adb_manager.py +++ b/src/core/adb_manager.py @@ -479,15 +479,9 @@ class ADBManager: if self.current_process is not None: try: # If already finished, don't terminate - try: - poll_result = None - if hasattr(self.current_process, 'poll'): - poll_result = self.current_process.poll() - if poll_result is not None: - self.current_process = None - return False - except Exception: - pass + if self.current_process.poll() is not None: + self.current_process = None + return False self.current_process.terminate() try: self.current_process.wait(timeout=2) diff --git a/src/core/platform_tools.py b/src/core/platform_tools.py index 986ad1e..35c1473 100644 --- a/src/core/platform_tools.py +++ b/src/core/platform_tools.py @@ -98,11 +98,6 @@ def ensure_platform_tools_in_user_dir(version_tag: Optional[str] = "latest") -> resp.raise_for_status() zip_path = os.path.join(tmp_dir, "platform-tools.zip") - # Ensure temp directory exists (legacy tests may mock mkdtemp to non-existent path) - try: - os.makedirs(tmp_dir, exist_ok=True) - except Exception: - pass with open(zip_path, "wb") as fh: for chunk in resp.iter_content(chunk_size=8192): if chunk: diff --git a/src/gui/components/file_browser.py b/src/gui/components/file_browser.py index d1e743f..b8175bf 100644 --- a/src/gui/components/file_browser.py +++ b/src/gui/components/file_browser.py @@ -15,9 +15,7 @@ class AndroidFileBrowser: self.parent = parent_window self.adb_manager = adb_manager self.path_callback = path_callback - - # Show the browser immediately - self.show_browser() + def show_browser(self, direction="pull"): """Show a browsable Android folder tree. diff --git a/src/gui/main_window.py b/src/gui/main_window.py index 7198c8e..d87ba83 100644 --- a/src/gui/main_window.py +++ b/src/gui/main_window.py @@ -226,8 +226,8 @@ class AndroidFileHandlerGUI(tk.Tk): def on_path_selected(path): self.android_path_selector.set_path(path) self._validate_paths_and_update_button() - browser = AndroidFileBrowser(self, self.adb_manager, on_path_selected) + browser.show_browser(direction="pull") def browse_local_folder(self): """Browse for local file or folder selection.""" diff --git a/src/managers/transfer_manager.py b/src/managers/transfer_manager.py index b1cd7f8..b5ab2f9 100644 --- a/src/managers/transfer_manager.py +++ b/src/managers/transfer_manager.py @@ -173,19 +173,6 @@ class TransferManager: # Handle errors on main thread if transfer_id == self.current_transfer_id and 'show_error' in self.ui_callbacks: self.parent.after(0, lambda: self.ui_callbacks["show_error"](f"Transfer error: {str(e)}")) - - # Start transfer in background thread - self.current_transfer_id += 1 - transfer_id = self.current_transfer_id - - threading.Thread( - target=self._transfer_thread, - args=(direction, source_path, dest_path, transfer_id, is_file), - daemon=True - ).start() - - return True - def cancel_transfer(self) -> bool: """Cancel the current transfer operation. diff --git a/tests/test_basic.py b/tests/test_basic.py deleted file mode 100644 index 2118ce8..0000000 --- a/tests/test_basic.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Simple test to verify pytest setup.""" - -def test_basic(): - """Basic test to verify pytest is working.""" - assert 1 + 1 == 2 - - -def test_imports(): - """Test that we can import our modules.""" - try: - from src.utils.file_deduplication import FileDeduplicator - deduplicator = FileDeduplicator() - assert deduplicator is not None - except ImportError as e: - pytest.fail(f"Failed to import FileDeduplicator: {e}") - - -if __name__ == '__main__': - import pytest - pytest.main([__file__]) \ No newline at end of file