taskbridgeapp.reminders.controller.ReminderController
- class taskbridgeapp.reminders.controller.ReminderController
Bases:
objectContains various static methods for the stages of reminder synchronisation.
Methods
Associate local reminder lists with remote task calendars.
Connect to the remote CalDav server.
Count the number of local completed reminders.
Delete completed reminders.
Fetch local reminder lists
Fetch remote reminders.
Synchronise deleted local reminder lists / remote task calendars.
Synchronise deleted reminders.
Synchronise reminders.
Save list of reminders to SQLite database.
Attributes
Headers to send to the remote calendar server (currently unused)
Password of the remote calendar server (this is stored in KeyChain)
URL of the remote calendar server
Username of the remote calendar server
Local reminder lists
Remote note calendars
List of reminder lists to be synchronised
- CALDAV_HEADERS = {}
Headers to send to the remote calendar server (currently unused)
- CALDAV_PASSWORD = ''
Password of the remote calendar server (this is stored in KeyChain)
- CALDAV_URL = ''
URL of the remote calendar server
- CALDAV_USERNAME = ''
Username of the remote calendar server
- LOCAL_LISTS = []
Local reminder lists
- REMOTE_CALENDARS = []
Remote note calendars
- TO_SYNC = []
List of reminder lists to be synchronised
- __init__()
- static associate_containers()
Associate local reminder lists with remote task calendars.
- Return type:
tuple[bool,str] |tuple[bool,List[ReminderContainer]]- Returns:
-success (
bool) - true if associations are successfully created.-data (
str|List[ReminderContainer]) - error message on failure, or list of reminder containers.
- static connect_caldav()
Connect to the remote CalDav server.
- Return type:
tuple[bool,str]- Returns:
-success (
bool) - true if a connection is successfully made.-data (
str) - success message.
- static count_completed()
Count the number of local completed reminders.
- Return type:
tuple[bool,str] |tuple[bool,int]- Returns:
-success (
bool) - true if completed reminders are counted successfully.-data (
str|int) - error message on failure, or number of completed reminders.
- static delete_completed()
Delete completed reminders.
- Return type:
tuple[bool,str]- Returns:
-success (
bool) - true if completed reminders are deleted successfully.-data (
str) - error message on failure, or success message.
- static fetch_local_reminders()
Fetch local reminder lists
- Return type:
tuple[bool,str]- Returns:
-success (
bool) - true if local reminder lists are fetched successfully.-data (
str) - error message on failure, or success message.
- static fetch_remote_reminders()
Fetch remote reminders.
- Return type:
tuple[bool,str]- Returns:
-success (
bool) - true if remote reminders are fetched successfully.-data (
str) - error message on failure, or success message.
- static sync_deleted_containers()
Synchronise deleted local reminder lists / remote task calendars.
- Return type:
tuple[bool,str]- Returns:
-success (
bool) - true if reminder containers are synchronised successfully.-data (
str) - error message on failure, or success message.
- static sync_deleted_reminders()
Synchronise deleted reminders.
- Return type:
tuple[bool,str]- Returns:
-success (
bool) - true if deleted reminders are synchronised successfully.-data (
str) - error message on failure, or success message.
- static sync_reminders()
Synchronise reminders. Returns a dictionary with the following keys:
remote_added- name of reminders added to the remote calendar asList[str].remote_updated- name of reminders updated in the remote calendar asList[str].local_added- name of reminders added to the local list asList[str].local_updated- name of reminders updated in the local list asList[str].
Any of the above may be empty if no such changes were made.
- Return type:
tuple[bool,str] |tuple[bool,dict]- Returns:
-success (
bool) - true if notes are successfully synchronised.-data (
str|dict) - error message on failure, ordictwith results as above.
- static sync_reminders_to_db()
Save list of reminders to SQLite database.
- Return type:
tuple[bool,str]- Returns:
-success (
bool) - true if reminders are saved successfully.-data (
str) - error message on failure, or success message.