taskbridgeapp.notes.controller.NoteController
- class taskbridgeapp.notes.controller.NoteController
Bases:
objectContains various static methods for the stages of note synchronisation.
Methods
Associate local/remote folders.
Get the list of local notes folders.
Get the list of remote note folders.
Synchronise notes deleted locally/remotely.
Synchronise deleted local/remote notes folders.
Synchronise notes.
Attributes
Dictionary of associations
List of local note folders
Path to the remote notes folder
List of remote note folders
-
ASSOCIATIONS:
dict= {} Dictionary of associations
-
LOCAL_NOTE_FOLDERS:
List[LocalNoteFolder] = [] List of local note folders
-
REMOTE_NOTE_FOLDER:
Path= None Path to the remote notes folder
-
REMOTE_NOTE_FOLDERS:
List[RemoteNoteFolder] = [] List of remote note folders
- __init__()
- static associate_folders()
Associate local/remote folders.
- Return type:
tuple[bool,str] |tuple[bool,List[NoteFolder]]- Returns:
-success (
bool) - true if the folders are successfully associated.-data (
str|List[NoteFolder]) - error message on failure, or list of associations on success.
- static get_local_folders()
Get the list of local notes folders.
- Return type:
tuple[bool,str]- Returns:
-success (
bool) - true if the folders are successfully retrieved.-data (
str) - error message on failure, or success message.
- static get_remote_folders()
Get the list of remote note folders.
- Return type:
tuple[bool,str]- Returns:
-success (
bool) - true if the folders are successfully retrieved.-data (
str) - error message on failure, or success message.
- static sync_deleted_notes()
Synchronise notes deleted locally/remotely.
- Return type:
tuple[bool,str]- Returns:
-success (
bool) - true if note deletions are successfully synchronised.-data (
str) - error message on failure, or success message.
- static sync_folder_deletions()
Synchronise deleted local/remote notes folders.
- Return type:
tuple[bool,str]- Returns:
-success (
bool) - true if the folders deletions are successfully synchronised.-data (
str) - error message on failure, or success message.
- static sync_notes()
Synchronise notes. Returns a dictionary with the following keys:
remote_added- name of notes added to the remote folder asList[str].remote_updated- name of notes updated in the remote folder asList[str].local_added- name of notes added to the local folder asList[str].local_updated- name of notes updated in the local folder 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.
-
ASSOCIATIONS: