Throw TypeError on invalid destination, add _metadata_path attribute
This commit is contained in:
parent
aea24e2b6e
commit
0ccb6764cd
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user