Skip to content

Commit

Permalink
output attachments for tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
dewenni committed Nov 3, 2024
1 parent 9bf4fd2 commit ec3c06e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/lanis.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def main():
current_tasks = client.get_tasks()
last_tasks = load_last_tasks()

print(current_tasks)

# Prüfen, ob es neue Aufgaben gibt
if has_new_tasks(current_tasks, last_tasks):
formattedTasks = formatTasks(current_tasks)
Expand Down
11 changes: 10 additions & 1 deletion app/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,23 @@ def formatTasks(tasks):
'date': task.date.strftime('%d.%m.%Y'),
'subject_name': task.subject_name,
'teacher': task.teacher,
'description': task.description
'description': task.description,
'attachments': task.attachment # Anhänge hinzufügen
}

# Formatiere die Aufgabe für die Ausgabe
formatted_task = (f"Fach: {task_data['subject_name']}\n"
f"Lehrer: {task_data['teacher']}\n"
f"Datum: {task_data['date']}\n"
f"Titel: {task_data['title']}\n"
f"Beschreibung: {task_data['description']}")

# Falls Anhänge vorhanden sind, füge die Namen hinzu
if task_data['attachments']:
formatted_task += "\nAnhänge:\n" + "\n".join(f"- {attachment}" for attachment in task_data['attachments'])

formatted_tasks.append(formatted_task)

except AttributeError:
# Falls ein Attribut fehlt, überspringe diese Aufgabe
continue
Expand All @@ -73,3 +81,4 @@ def formatTasks(tasks):
return "\n\n".join(formatted_tasks)



4 changes: 2 additions & 2 deletions changeNew.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Es kann jedoch gerne schon genutzt und getestet werden.

## changelog

- Logging angepasst
- github Workflow angepasst
- Logging angepasst (Zeitstempel ergänzt)
- Anhänge bei Hausaufgaben mit ausgeben

0 comments on commit ec3c06e

Please sign in to comment.