diff --git a/rbackup/config.py b/rbackup/config.py index 535a141..d6c4be6 100644 --- a/rbackup/config.py +++ b/rbackup/config.py @@ -43,8 +43,6 @@ def merge_files(files): """Parse, filter, and sort through config files to create a single --files-from argument. - Any files included that do not exist send a warning to the log. - >>> merge_files(get_files_by_suffix('-include.conf')) # doctest: +ELLIPSIS PosixPath('/tmp/...') diff --git a/rbackup/struct/hierarchy.py b/rbackup/struct/hierarchy.py index 4bc700d..ef40be1 100644 --- a/rbackup/struct/hierarchy.py +++ b/rbackup/struct/hierarchy.py @@ -19,13 +19,17 @@ METADATA_WRITE = "w" # ========== Classes ========== class Hierarchy(PathLike): - """A class for organizing the backup root hierarchy. + """A general class for organizing a hierarchy of data. - Upon creation of a Hierarchy object, it is up to the caller - to call either :func:`shutil.mkdir` or a related method to create + Hierarchy objects are non-intrusive in that they do not affect + the filesystem upon creation. It is up to the caller + to call either :func:`shutil.mkdir` or related method to create the directory structure it emulates. - For consistency, ``Hierarchy`` objects always store and return absolute paths. + Implementation Details + + * For consistency, ``Hierarchy`` objects always store and return absolute paths + * Data for all ``Hierarchy`` objects and subclassed objects use JSON for serialization """ def __init__(self, dest): @@ -89,7 +93,7 @@ class Hierarchy(PathLike): def write_metadata(self, attr): """Write this repository's metadata to its metadata file. - .. note:: This write operation is atomic to the caller. + .. note:: This write operation is atomic to the caller. :param attr: class data to write to file :type attr: any type diff --git a/rbackup/struct/repository.py b/rbackup/struct/repository.py index caab64b..314d636 100644 --- a/rbackup/struct/repository.py +++ b/rbackup/struct/repository.py @@ -2,6 +2,16 @@ .. moduleauthor:: Eric Torres .. module:: rbackup.struct.repository :synopsis: Classes for structuring a backup repository. + +A repository is a directory that contains backup data +sequestered into snapshots and a symlink to the most +recently created snapshot. + +Properties + +* Each snapshot in a repository is unaware of one another, + this is the job of the repository to organize +* Has a symlink pointing to the most recently created snapshot """ import datetime import logging @@ -26,17 +36,6 @@ VALID_SNAPSHOT_NAME = r"[\w._+-]+[^/]*" class Repository(Hierarchy): """A class for interacting with a backup repository. - Repository is a mutable, stateful class for representing a - directory that contains backup data sequestered into snapshots - and a symlink to the most recently created snapshot. - - Properties - - * Each snapshot in a repository is unaware of one another, - this is the job of the repository to organize - * The only way snapshots are linked together is in files - that are hard-linked together - Snapshots can be accessed on a one-by-one basis through iteration. :: @@ -71,6 +70,7 @@ class Repository(Hierarchy): >>> len(Repository('backup')) 1 """ + """Snapshots are serialized as their names relative to the repository data directory, but have their full paths during runtime. diff --git a/rbackup/struct/snapshot.py b/rbackup/struct/snapshot.py index 339e183..48981c7 100644 --- a/rbackup/struct/snapshot.py +++ b/rbackup/struct/snapshot.py @@ -1,7 +1,7 @@ """ .. moduleauthor:: Eric Torres .. module:: rbackup.struct.snapshot - :synopsis: Classes for creating the backup hierarchy. + :synopsis: Class for creating the backup snapshot hierarchy. """ import logging