This commit is contained in:
2025-08-25 11:18:48 -05:00
committed by Jason Ross
parent 7df056ef60
commit 1bd77ca375
14 changed files with 92 additions and 54 deletions
+14 -10
View File
@@ -4,41 +4,45 @@ Test script to debug folder parsing
"""
import sys
import os
sys.path.insert(0, 'src')
# Add the src directory to Python path for imports
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), "src"))
from adb_manager import ADBManager
def main():
adb = ADBManager()
print("Testing folder parsing...")
result = adb.run_adb_command(['shell', 'ls', '-la', '/sdcard/'])
result = adb.run_adb_command(["shell", "ls", "-la", "/sdcard/"])
print(f"Return code: {result[2]}")
lines = result[0].strip().split('\n')
lines = result[0].strip().split("\n")
print(f"Total lines: {len(lines)}")
print("\nFirst 10 lines:")
for i, line in enumerate(lines[:10]):
print(f" {i}: {repr(line)}")
print("\nParsing directories:")
folders = []
for i, line in enumerate(lines):
if line.startswith('d'):
if line.startswith("d"):
parts = line.split()
print(f" Line {i}: {len(parts)} parts")
if len(parts) >= 8: # Changed from 9 to 8
folder_name = ' '.join(parts[7:]) # Changed from 8 to 7
folder_name = " ".join(parts[7:]) # Changed from 8 to 7
print(f" Folder name: {repr(folder_name)}")
if folder_name not in ['.', '..']:
if folder_name not in [".", ".."]:
folders.append(folder_name)
print(f" ✅ Added: {repr(folder_name)}")
else:
print(f" ❌ Skipped: {repr(folder_name)}")
print(f"\nFinal folders list ({len(folders)} items):")
for folder in sorted(folders):
print(f" - {repr(folder)}")
if __name__ == "__main__":
main()