From 5d6a1e1f7d00e1686745a5e9f1984819684ef0c9 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Wed, 17 Apr 2019 12:18:52 -0700 Subject: [PATCH] Implement deletion --- rbackup/struct/hierarchy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rbackup/struct/hierarchy.py b/rbackup/struct/hierarchy.py index 531b1d2..9fd9f66 100644 --- a/rbackup/struct/hierarchy.py +++ b/rbackup/struct/hierarchy.py @@ -5,6 +5,7 @@ """ import json import logging +import shutil from os import PathLike from pathlib import Path @@ -89,7 +90,6 @@ class Hierarchy(PathLike): def cleanup(self, **kwargs): """Clean up this Hierarchy's data from the filesystem.""" - import shutil syslog.info(f"Performing cleanup on {self._path}") @@ -101,6 +101,8 @@ class Hierarchy(PathLike): ) return + shutil.rmtree(self) + def read_metadata(self): """Read this repository's metadata from its file and then return it.