From 0ccb6764cd5ae6ed45705f44d40ed90f2f0aed67 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Thu, 28 Mar 2019 12:07:31 -0700 Subject: [PATCH] Throw TypeError on invalid destination, add _metadata_path attribute --- rbackup/hierarchy/hierarchy.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rbackup/hierarchy/hierarchy.py b/rbackup/hierarchy/hierarchy.py index 708015b..3d3b294 100644 --- a/rbackup/hierarchy/hierarchy.py +++ b/rbackup/hierarchy/hierarchy.py @@ -3,8 +3,13 @@ .. module:: rbackup.hierarchy.hierarchy :synopsis: Classes for creating the backup hierarchy. """ +import logging + from pathlib import Path +# ========== Logging Setup =========== +syslog = logging.getLogger(__name__) + # ========== Classes ========== class Hierarchy: @@ -32,7 +37,12 @@ class Hierarchy: :param dest: the root directory of the backup hierarchy :type dest: str, path-like object """ - self._path = Path(dest) + try: + self._path = Path(dest) + except TypeError as e: + raise e + + self._metadata_path = self.path / ".metadata" @property def path(self):