unused code removed

This commit is contained in:
Tim Bendt
2025-05-08 12:06:42 -06:00
parent 9f4ec1b6c5
commit e0e7e6ac76
2 changed files with 4 additions and 19 deletions

View File

@@ -84,7 +84,6 @@ async def delete_with_aiohttp(url, headers):
async def synchronize_maildir_async(maildir_path, headers, progress, task_id):
last_sync = load_last_sync_timestamp()
current_time = time.time()
# Find messages moved from "new" to "cur" and mark them as read
new_dir = os.path.join(maildir_path, 'new')
@@ -295,7 +294,6 @@ def create_maildir_structure(base_path):
async def save_mime_to_maildir_async(maildir_path, email_data, attachments_dir, headers, progress):
# Create a new EmailMessage object
msg = EmailMessage()
# Determine the directory based on isRead
target_dir = 'cur' if email_data.get('isRead', False) else 'new'
id = email_data.get('id', '')
@@ -363,7 +361,7 @@ def save_email_to_maildir(maildir_path, email_data, attachments_dir, progress):
# Download attachments
progress.console.print(f"Downloading attachments for message: {msg['Message-ID']}")
for attachment in email_data.get('attachments', []):
attachment_id = attachment.get('id')
attachment_name = attachment.get('name', 'unknown')
attachment_content = attachment.get('contentBytes')
if attachment_content:
@@ -396,12 +394,7 @@ def save_email_to_maildir(maildir_path, email_data, attachments_dir, progress):
async def main():
# Load cached timestamp if it exists
if os.path.exists(cache_timestamp_file):
with open(cache_timestamp_file, 'r') as f:
cache_timestamp = json.load(f)
else:
cache_timestamp = {}
# Save emails to Maildir
maildir_path = os.getenv('MAILDIR_PATH', os.path.expanduser('~/Mail')) + "/corteva"
@@ -423,14 +416,7 @@ async def main():
if os.path.exists(cache_file):
cache.deserialize(open(cache_file, 'r').read())
# Filepath for caching ETag
etag_cache_file = 'etag_cache.json'
# Load cached ETag if it exists
if os.path.exists(etag_cache_file):
with open(etag_cache_file, 'r') as f:
etag_cache = json.load(f)
else:
etag_cache = {}
# Authentication
authority = f'https://login.microsoftonline.com/{tenant_id}'