# Path: zfs_autobackup/CachedProperty.py
# class CachedProperty(object):
#     """ A property that is only computed once per instance and
#     then stores the result in _cached_properties of the object.
# 
#         Source: https://github.com/bottlepy/bottle/commit/fa7733e075da0d790d809aa3d2f53071897e6f76
#         """
# 
#     def __init__(self, func):
#         self.__doc__ = getattr(func, '__doc__')
#         self.func = func
# 
#     def __get__(self, obj, cls):
#         if obj is None:
#             return self
# 
#         propname = self.func.__name__
# 
#         if not hasattr(obj, '_cached_properties'):
#             obj._cached_properties = {}
# 
#         if propname not in obj._cached_properties:
#             obj._cached_properties[propname] = self.func(obj)
#             # value = obj.__dict__[propname] = self.func(obj)
# 
#         return obj._cached_properties[propname]
# 
#     @staticmethod
#     def clear(obj):
#         """clears cache of obj"""
#         if hasattr(obj, '_cached_properties'):
#             obj._cached_properties = {}
# 
#     @staticmethod
#     def is_cached(obj, propname):
#         if hasattr(obj, '_cached_properties') and propname in obj._cached_properties:
#             return True
#         else:
#             return False
# 
# Path: zfs_autobackup/ExecuteNode.py
# class ExecuteError(Exception):
#     pass


import re
import time
from .CachedProperty import CachedProperty
from .ExecuteNode import ExecuteError
            self.verbose("Creating filesystem")
            self.zfs_node.run(["zfs", "create", self.name])

        self.force_exists = True

    def destroy(self, fail_exception=False, deferred=False, verbose=True):
        """destroy the dataset. by default failures are not an exception, so we
        can continue making backups

        Args:
            :type fail_exception: bool
        """

        if verbose:
            self.verbose("Destroying")
        else:
            self.debug("Destroying")

        if self.is_snapshot:
            self.release()

        try:
            if deferred and self.is_snapshot:
                self.zfs_node.run(["zfs", "destroy", "-d", self.name])
            else:
                self.zfs_node.run(["zfs", "destroy", self.name])

            self.invalidate()
            self.force_exists = False
            return True

# Path: zfs_autobackup/CachedProperty.py
# class CachedProperty(object):
#     """ A property that is only computed once per instance and
#     then stores the result in _cached_properties of the object.
# 
#         Source: https://github.com/bottlepy/bottle/commit/fa7733e075da0d790d809aa3d2f53071897e6f76
#         """
# 
#     def __init__(self, func):
#         self.__doc__ = getattr(func, '__doc__')
#         self.func = func
# 
#     def __get__(self, obj, cls):
#         if obj is None:
#             return self
# 
#         propname = self.func.__name__
# 
#         if not hasattr(obj, '_cached_properties'):
#             obj._cached_properties = {}
# 
#         if propname not in obj._cached_properties:
#             obj._cached_properties[propname] = self.func(obj)
#             # value = obj.__dict__[propname] = self.func(obj)
# 
#         return obj._cached_properties[propname]
# 
#     @staticmethod
#     def clear(obj):
#         """clears cache of obj"""
#         if hasattr(obj, '_cached_properties'):
#             obj._cached_properties = {}
# 
#     @staticmethod
#     def is_cached(obj, propname):
#         if hasattr(obj, '_cached_properties') and propname in obj._cached_properties:
#             return True
#         else:
#             return False
# 
# Path: zfs_autobackup/ExecuteNode.py
# class ExecuteError(Exception):
#     pass


# Path: zfs_autobackup/ZfsDataset.py
import re
import time
from .CachedProperty import CachedProperty
from .ExecuteNode import ExecuteError

            self.verbose("Creating filesystem")
            self.zfs_node.run(["zfs", "create", self.name])

        self.force_exists = True

    def destroy(self, fail_exception=False, deferred=False, verbose=True):
        """destroy the dataset. by default failures are not an exception, so we
        can continue making backups

        Args:
            :type fail_exception: bool
        """

        if verbose:
            self.verbose("Destroying")
        else:
            self.debug("Destroying")

        if self.is_snapshot:
            self.release()

        try:
            if deferred and self.is_snapshot:
                self.zfs_node.run(["zfs", "destroy", "-d", self.name])
            else:
                self.zfs_node.run(["zfs", "destroy", self.name])

            self.invalidate()
            self.force_exists = False
            return True

        except ExecuteError: