MCPcopy Index your code
hub / github.com/flet-dev/flet / move_task

Function move_task

sdk/python/examples/community/mind_queue/main.py:377–389  ·  view source on GitHub ↗

Move a task up or down within its header (no UI calls here).

(header: str, index: int, direction: int)

Source from the content-addressed store, hash-verified

375 open_dialog(dlg)
376
377 def move_task(header: str, index: int, direction: int):
378 """Move a task up or down within its header (no UI calls here)."""
379 if header not in system_data:
380 return
381 tasks = system_data[header]
382 new_index = index + direction
383 if new_index < 0 or new_index >= len(tasks):
384 return
385 try:
386 tasks[index], tasks[new_index] = tasks[new_index], tasks[index]
387 save_data(data)
388 except Exception as ex:
389 print("move_task error:", ex)
390
391 def open_task_actions(header: str, index: int):
392 """Long-press menu: Move up / Move down / Edit / Delete."""

Callers 2

do_move_upFunction · 0.85
do_move_downFunction · 0.85

Calls 1

save_dataFunction · 0.85

Tested by

no test coverage detected