capturegraph.procedures.toolkits.metadata.notification_manager
#
Notification Management Toolkit#
This module provides utilities for configuring and managing notification schedules for capture targets. Notifications remind users when it's time to capture data and help maintain consistent data collection workflows.
The toolkit supports two notification modes:
-
Time-of-day notifications: Trigger at specific times each day
-
Interval notifications: Trigger at fixed intervals after each capture
You can also just use the configure_notifications() function to ask the user for their preferences and set up notifications accordingly.
All notification settings are persisted and can be configured once per capture target.
set_next_notification_time(notification_time)
#
Saves the next scheduled notification time to persistent storage.
This function stores the calculated next notification time so the app can schedule appropriate alerts and reminders for the user.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
notification_time
|
Procedure[PTime]
|
The calculated time when the next notification should occur |
required |
Returns:
| Type | Description |
|---|---|
Procedure[PVoid]
|
A procedure that saves the notification time to the target's notification file |
Source code in capturegraph-lib/capturegraph/procedures/toolkits/metadata/notification_manager.py
configure_time_of_day_notification()
#
Configures notifications to fire at specific times of day.
Sets up notifications that trigger at a fixed time each day (e.g., 9:00 AM daily). Users specify the interval between notifications in days and the preferred time of day. Ideal for daily data collection routines.
Returns:
| Type | Description |
|---|---|
Procedure[PVoid]
|
A procedure that configures time-of-day based notifications |
Example
User might configure notifications to fire every 2 days at 9:00 AM.
Source code in capturegraph-lib/capturegraph/procedures/toolkits/metadata/notification_manager.py
configure_interval_notifications()
#
Configures notifications to fire at fixed intervals after each capture.
Sets up notifications that trigger a specified amount of time after each data capture event (e.g., 4 hours after each capture). Users specify the interval duration. Ideal for event-driven or irregular data collection.
Returns:
| Type | Description |
|---|---|
Procedure[PVoid]
|
A procedure that configures interval-based notifications |
Example
User might configure notifications to fire 6 hours after each capture.
Source code in capturegraph-lib/capturegraph/procedures/toolkits/metadata/notification_manager.py
configure_notifications()
#
Main entry point for configuring all notification settings.
Presents users with options to enable/disable notifications and choose between time-of-day or interval-based scheduling. This is typically called once per capture target to set up the notification preferences.
Returns:
| Type | Description |
|---|---|
Procedure[PVoid]
|
A procedure that configures notifications based on user choices |