fix misleading docstrings for index file hook
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Thu, 10 Aug 2017 08:13:18 +0000 (10:13 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 2 Apr 2018 11:34:09 +0000 (13:34 +0200)
deltatar/deltatar.py

index ee5e41b..b247fdb 100644 (file)
@@ -221,9 +221,9 @@ class DeltaTar(object):
            'bz2'      open with bzip2 compression
 
         - index_name_func: function that sets a custom name for the index file.
-          This function receives the backup_path and if it's a full backup as
-          arguments and must return the name of the corresponding index file.
-          Optional, DeltaTar gives index files a "backup.index" name by default.
+          This function receives a flag to indicate whether the name will be
+          used for a full or diff backup. The backup path will be prepended to
+          its return value.
 
         - volume_name_func: function that defines the name of tar volumes. It
           receives the backup_path, if it's a full backup and the volume number,
@@ -293,10 +293,9 @@ class DeltaTar(object):
 
     def index_name_func(self, is_full):         # pylint: disable=method-hidden
         '''
-        function that sets a custom name for the index file. This function
-        receives the backup_path and if it's a full backup as arguments and must
-        return the name of the corresponding index file. Optional, DeltaTar gives
-        index files a name by default.
+        Callback for setting a custom name for the index file. Depending on
+        whether *is_full* is set, it will create a suitable name for a full
+        or a diff backup.
         '''
         prefix = "bfull" if is_full else "bdiff"
         date_str = self.current_time.strftime("%Y-%m-%d-%H%M")