From 9f4ec1b6c58da6260eab3010cf2cd686ff7f0170 Mon Sep 17 00:00:00 2001 From: Tim Bendt Date: Thu, 8 May 2025 12:03:38 -0600 Subject: [PATCH] ruff lint fixes --- fetch_outlook.py | 4 ++-- maildir_gtd/actions/newest.py | 1 - maildir_gtd/actions/next.py | 12 ------------ maildir_gtd/actions/oldest.py | 1 - maildir_gtd/actions/previous.py | 1 - maildir_gtd/actions/show_message.py | 1 - maildir_gtd/actions/task.py | 2 -- maildir_gtd/app.py | 2 +- maildir_gtd/widgets/EnvelopeHeader.py | 6 +++--- 9 files changed, 6 insertions(+), 24 deletions(-) diff --git a/fetch_outlook.py b/fetch_outlook.py index c6ec854..aed570c 100644 --- a/fetch_outlook.py +++ b/fetch_outlook.py @@ -242,7 +242,7 @@ async def fetch_calendar_async(headers, progress, task_id): # Get the next page URL from @odata.nextLink calendar_url = response_data.get('@odata.nextLink') - output_file = f'output_ics/outlook_events_latest.ics' + output_file = 'output_ics/outlook_events_latest.ics' if not dry_run: os.makedirs(os.path.dirname(output_file), exist_ok=True) progress.console.print(f"Saving events to {output_file}...") @@ -300,7 +300,7 @@ async def save_mime_to_maildir_async(maildir_path, email_data, attachments_dir, target_dir = 'cur' if email_data.get('isRead', False) else 'new' id = email_data.get('id', '') if not id: - progress.console.print(f"Message ID not found. Skipping save.") + progress.console.print("Message ID not found. Skipping save.") return email_filename = f"{id}.eml" email_filepath = os.path.join(maildir_path, target_dir, email_filename) diff --git a/maildir_gtd/actions/newest.py b/maildir_gtd/actions/newest.py index 8d61cde..e2d5d7e 100644 --- a/maildir_gtd/actions/newest.py +++ b/maildir_gtd/actions/newest.py @@ -1,5 +1,4 @@ -import asyncio async def action_newest(app) -> None: """Show the previous email message by finding the next lower ID from the list of envelope IDs.""" diff --git a/maildir_gtd/actions/next.py b/maildir_gtd/actions/next.py index a6f8c0b..b4d2527 100644 --- a/maildir_gtd/actions/next.py +++ b/maildir_gtd/actions/next.py @@ -1,15 +1,3 @@ -import logging -from typing import Iterable -from textual import on -from textual.app import App, ComposeResult, SystemCommand -from textual.logging import TextualHandler -from textual.screen import Screen -from textual.widgets import Header, Footer, Static, Label, Input, Button -from textual.reactive import Reactive -from textual.binding import Binding -from textual.timer import Timer -from textual.containers import ScrollableContainer, Horizontal, Vertical, Grid -import asyncio async def action_next(app) -> None: """Show the next email message by finding the next higher ID from the list of envelope IDs.""" diff --git a/maildir_gtd/actions/oldest.py b/maildir_gtd/actions/oldest.py index 467393b..9e8bb1f 100644 --- a/maildir_gtd/actions/oldest.py +++ b/maildir_gtd/actions/oldest.py @@ -1,5 +1,4 @@ -import asyncio def action_oldest(app) -> None: """Show the previous email message by finding the next lower ID from the list of envelope IDs.""" diff --git a/maildir_gtd/actions/previous.py b/maildir_gtd/actions/previous.py index fa70133..94383b5 100644 --- a/maildir_gtd/actions/previous.py +++ b/maildir_gtd/actions/previous.py @@ -1,5 +1,4 @@ -import subprocess def action_previous(app) -> None: """Show the previous email message by finding the next lower ID from the list of envelope IDs.""" diff --git a/maildir_gtd/actions/show_message.py b/maildir_gtd/actions/show_message.py index 8a2221d..a1381c9 100644 --- a/maildir_gtd/actions/show_message.py +++ b/maildir_gtd/actions/show_message.py @@ -1,5 +1,4 @@ import logging -import subprocess from textual.logging import TextualHandler diff --git a/maildir_gtd/actions/task.py b/maildir_gtd/actions/task.py index 378319a..f146793 100644 --- a/maildir_gtd/actions/task.py +++ b/maildir_gtd/actions/task.py @@ -1,7 +1,5 @@ import asyncio -import subprocess -from textual import work from maildir_gtd.screens.CreateTask import CreateTaskScreen diff --git a/maildir_gtd/app.py b/maildir_gtd/app.py index 7a25650..4c3e4ee 100644 --- a/maildir_gtd/app.py +++ b/maildir_gtd/app.py @@ -21,7 +21,7 @@ from textual.widgets import Footer, Static, Label, Markdown, ListView, ListItem from textual.reactive import reactive, Reactive from textual.binding import Binding from textual.timer import Timer -from textual.containers import ScrollableContainer, Grid, Vertical, Horizontal +from textual.containers import ScrollableContainer, Vertical, Horizontal from actions.archive import archive_current from actions.delete import delete_current diff --git a/maildir_gtd/widgets/EnvelopeHeader.py b/maildir_gtd/widgets/EnvelopeHeader.py index f0fdd4d..0bb9e27 100644 --- a/maildir_gtd/widgets/EnvelopeHeader.py +++ b/maildir_gtd/widgets/EnvelopeHeader.py @@ -1,7 +1,7 @@ from textual.reactive import Reactive -from textual.app import RenderResult, ComposeResult -from textual.widgets import Static, Label -from textual.containers import Vertical, Horizontal, Container, ScrollableContainer +from textual.app import ComposeResult +from textual.widgets import Label +from textual.containers import Horizontal, ScrollableContainer class EnvelopeHeader(ScrollableContainer):