excellent

This commit is contained in:
Tim Bendt
2025-05-02 01:16:13 -04:00
parent fe22010a68
commit 615aeda3b9
20 changed files with 313 additions and 161 deletions

View File

@@ -9,20 +9,14 @@ from textual.reactive import Reactive
from textual.binding import Binding
from textual.timer import Timer
from textual.containers import ScrollableContainer, Horizontal, Vertical, Grid
import subprocess
import asyncio
def action_next(app) -> None:
async def action_next(app) -> None:
"""Show the next email message by finding the next higher ID from the list of envelope IDs."""
try:
result = subprocess.run(
["himalaya", "envelope", "list", "-o", "json", "-s", "9999"],
capture_output=True,
text=True
)
if result.returncode == 0:
import json
envelopes = json.loads(result.stdout)
ids = sorted(int(envelope['id']) for envelope in envelopes)
if (app.reload_needed):
app.action_fetch_list()
ids = sorted(int(envelope['id']) for envelope in app.all_envelopes)
for envelope_id in ids:
if envelope_id > int(app.current_message_id):
app.show_message(envelope_id)