taskbridgeapp.cli.tbcli.TaskBridgeCli
- class taskbridgeapp.cli.tbcli.TaskBridgeCli(args)
Bases:
objectDefines the functionality of the TaskBridge CLI.
Methods
Load settings from the configuration file, This is normally in ~/Library/Application Support/TaskBridge/conf.json, but may be overridden with the --config option.
Performs CalDAV authentication.
Override any of the default settings of the TaskBrdige CLI with settings found in a configuration file.
Override any settings (default or from configuration file) which have been specified as command-line options.
Perform pre-flight checks for notes synchronisation.
Perform pre-flight checks for reminders synchronisation.
Sets up the logging system.
Calls the varous controller methods to perform note synchronisation.
Calls the varous controller methods to perform reminder synchronisation.
Attributes
SETTINGS- __init__(args)
- __process_return(cb, error, code)
Process the return value of one of the controller method. If there is an error, this is logged and the CLI exits.
- Parameters:
cb (
Callable) – The controller function to run.error (
str) – The error message to display on failure.code (
int) – The exit code to use on error.
- Return type:
None
- apply_settings()
Load settings from the configuration file, This is normally in ~/Library/Application Support/TaskBridge/conf.json, but may be overridden with the –config option. Any configuration options specified via command-line options will override the values in the configuration file.
- Return type:
None
- authenticate_caldav()
Performs CalDAV authentication. If the –caldav-password option is used, this method will ask for a CalDAV password regardless of whether one is saved. If no password is saved, the CLI exits with an error.
- Return type:
bool- Returns:
True on finding or receiving a CalDAV password.
- static merge_settings(conf_file)
Override any of the default settings of the TaskBrdige CLI with settings found in a configuration file.
- Return type:
None
- override_config()
Override any settings (default or from configuration file) which have been specified as command-line options.
- Return type:
None
- static preflight_notes()
Perform pre-flight checks for notes synchronisation. This includes ensuring a remote notes folder is checked and ensuring associations (i.e. which note folders to sync and how) have been set.
- Return type:
bool- Returns:
True if all pre-flight checks are successful.
- static preflight_reminders()
Perform pre-flight checks for reminders synchronisation. This includes ensuring a CalDAV server, path and username have been set, and that the list of reminder lists to sync has been specified.
- Return type:
bool- Returns:
True if all pre-flight checks are successful.
- setup_logging()
Sets up the logging system.
- Return type:
Logger- Returns:
the logging helper for the CLI.
- static sync_notes()
Calls the varous controller methods to perform note synchronisation. If any stage fails, an error message is logged, and the CLI exits with a status code.
- Return type:
None
- static sync_reminders()
Calls the varous controller methods to perform reminder synchronisation. If any stage fails, an error message is logged, and the CLI exits with a status code.
- Return type:
None