MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / run_pending_reminders

Function run_pending_reminders

Scripts/Developer Base/Smart Notes.py:701–721  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

699
700# Run pending reminders
701def run_pending_reminders():
702 notes = load_notes()
703 reminders = notes.get('_reminders', [])
704 now = datetime.now()
705 changed = False
706 for r in list(reminders):
707 try:
708 dt = datetime.fromisoformat(r['datetime'])
709 except Exception:
710 continue
711 if dt <= now:
712 if ensure_termux_api():
713 try:
714 subprocess.check_call(['termux-notification', '--title', r['title'], '--content', r.get('text','')])
715 except Exception:
716 pass
717 reminders.remove(r)
718 changed = True
719 if changed:
720 notes['_reminders'] = reminders
721 save_notes(notes)
722
723# Main menu
724def main_menu(stdscr):

Callers 1

Smart Notes.pyFile · 0.70

Calls 3

load_notesFunction · 0.70
ensure_termux_apiFunction · 0.70
save_notesFunction · 0.70

Tested by

no test coverage detected