Application refinements #7

Merged
JMR-dev merged 8 commits from application-refinements into main 2025-09-22 22:01:53 +00:00
6 changed files with 5 additions and 51 deletions
Showing only changes of commit d131a04dbb - Show all commits
+3 -9
View File
1
@@ -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)
-5
View File
1
@@ -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:
+1 -3
View File
1
@@ -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.
+1 -1
View File
1
@@ -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."""
-13
View File
1
@@ -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.
-20
View File
1
@@ -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__])