Filemanager tkinter and ssh transfer

From vaila-multimodaltoolbox/vaila · View interactive version

Filemanager tkinter and ssh transfer is an AI agent skill from the GitHub repository vaila-multimodaltoolbox/vaila. Use when maintaining vailá File Manager Frame A buttons, previewed local operations, CLI parity, or interactive SSH transfer with status-file completion.

How to use this skill

Skill file

File Manager: previewed ops, CLI, and SSH transfer

Architecture since v0.3.137 (11 September 2026). Parameter collection is separate from execution. GUI and CLI share the same plan/execute path.

Modules

| File | Role |

|------|------|

| vaila/filemanager.py | build_plan / execute_plan, CLI (python -m vaila.filemanager), thin wrappers |

| vaila/filemanager_gui.py | Tkinter: fields → Preview → Apply; Transfer opens a terminal |

| vaila/task_feedback.py | >> vaila/filemanager: messages, WorkerTask queue, redaction |

| vaila.py Frame A | Lazy wrappers → copy_file, move_file, …, transfer_file → show_action |

Help: vaila/help/filemanager.md (+ .html). Button notes: docs/vaila_buttons/*-file.md. Diagnose failures with /debug → .agents/skills/debug/SKILL.md.

vailá maintenance rule (version/date)

When editing these modules (or any *.py), also update:

See AGENTS.md checklist.

Flow

Frame A / CLI args
    → FileManagerGUI or argparse
    → build_plan(action, source, …)   # fixed Target list + identity stamps
    → preview (dry-run / GUI Preview) # no silent changes
    → execute_plan(plan)              # worker thread in GUI; refuse stale/changed targets
    → Feedback summary + exit code

Invariants:

GUI vs CLI

uv run python -m vaila.filemanager copy --help
uv run python -m vaila.filemanager remove --source /data/tmp --pattern .tmp --removal-type ext --dry-run
uv run python -m vaila.filemanager transfer --local "/data/my files" --host server --user analyst --remote /data

Tkinter window ownership

Still use hybrid roots: if tk._default_root exists, open Toplevel + wait_window(); else Tk() + mainloop(). Implemented in filemanager_gui.show_action. Do not create a second Tk() under the main vailá process.

Keep StringVars / widgets alive for the window lifetime (bind to the window or class attrs). Returning from a non-blocking dialog while Entries still reference GC’d StringVars caused segfault 139 historically.

SSH Transfer

rsync/scp need a real TTY for passwords. Pattern:

  1. GUI collects local/host/user/port/remote/mode.
  2. Writes a temp script that runs python -m vaila.filemanager transfer … --status-file PATH.
  3. Launches an external terminal (gnome-terminal, etc.).
  4. Status line: Terminal opened - waiting for transfer result ≠ completed.
  5. When --status-file appears with an exit code, GUI shows success or failed (exit N).

Do not treat “terminal launched” as transfer success. Never auto-run real transfers from /debug.

Tests

uv run pytest tests/test_filemanager_operations.py tests/test_filetools_downloader.py -v

Coverage includes collisions, nested destination, stale targets after preview, cancel, VICON import, headless CLI, transfer argv safety + status-file, GUI/CLI equivalence, Frame A dispatch to show_action, and simulated Transfer success/failure (no real SSH).

GUI smoke needs a display; set VAILA_GUI_ARTIFACTS=/tmp/… for window PNGs.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.