From 1cc53f1178daf8fbbe1aed3bb357c882806b2239 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Sun, 14 Apr 2019 22:15:00 -0700 Subject: [PATCH] Add function for parsing a list from a config option --- rbackup/config.py | 4 ++-- rbackup/rsync.py | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/rbackup/config.py b/rbackup/config.py index e3f769c..5412346 100644 --- a/rbackup/config.py +++ b/rbackup/config.py @@ -40,7 +40,7 @@ def get_files_by_suffix(suffix): yield from CONFIG_DIR.glob(f"*{suffix}") -def load_list_from_option(parser, *, section="", option="", fallback=list()): +def load_list_from_option(parser, *, section="", option="", fallback=None): """Using a combination of ``ConfigParser`` and JSON, load a list from a configuration file option. @@ -53,7 +53,7 @@ def load_list_from_option(parser, *, section="", option="", fallback=list()): :returns: the list parsed by JSON :param fallback: the fallback value to return if the option is empty :type fallback: list - :rtype: list + :rtype: list or type of fallback value """ try: return json.loads(parser[section][option]) diff --git a/rbackup/rsync.py b/rbackup/rsync.py index c8d43b0..a0b9ff1 100644 --- a/rbackup/rsync.py +++ b/rbackup/rsync.py @@ -12,12 +12,9 @@ _RSYNC_BIN = "/usr/bin/rsync" DEFAULT_RSYNC_OPTS = [ "--acls", "--archive", - "--backup", - "--backup-dir=backup", "--hard-links", "--ignore-missing-args", "--prune-empty-dirs", - "--suffix=.old", "--recursive", "--xattrs", ]