diff -r 9dd2e5d57a7c -r 3dd525652dc8 config.py --- a/config.py Sun Jan 21 12:04:24 2018 +0000 +++ b/config.py Sun Jan 21 12:10:57 2018 +0000 @@ -22,7 +22,10 @@ # Default: retry every 15 minutes if unable to connect / unfinished backup 'retry_interval': 900, # Extract passphrases at startup or on demand? - '__extract_passphrases_at_startup': True, + 'extract_passphrases_at_startup': True, + # Do not insert a quit menu entry (useful for installing on computers of + # inexperienced users) + 'no_quit_menu_entry': False, # Borg settings 'borg': { 'executable': 'borg', @@ -40,6 +43,10 @@ def error(x): raise AssertionError(x) +def check_bool(cfg, field, descr, loc, default=None): + return check_field(cfg, field, descr, loc, default, + lambda x: isinstance(x, bool)) + def check_string(cfg, field, descr, loc, default=None): return check_field(cfg, field, descr, loc, default, lambda x: isinstance(x, str)) @@ -139,7 +146,8 @@ check_and_set(settings, 'backup_interval', 'top-level', defaults, check_nonneg_int) check_and_set(settings, 'retry_interval', 'top-level', defaults, check_nonneg_int) -check_and_set(settings, '__extract_passphrases_at_startup', 'top-level', defaults, check_nonneg_int) +check_and_set(settings, 'extract_passphrases_at_startup', 'top-level', defaults, check_nonneg_int) +check_and_set(settings, 'no_quit_menu_entry', 'top-level', defaults, check_bool) check_and_set(settings, 'borg', 'top-level', defaults, check_dict) # Check parameters within 'borg' if True: