How to use the omniduct.utils.storage.ensure_path_exists function in omniduct

To help you get started, we’ve selected a few omniduct examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github airbnb / omniduct / omniduct / caches / local.py View on Github external
def get_path(self, id_duct, id_str, create=False):
        hash = self.get_hash(id_str)
        if isinstance(id_duct, six.string_types):
            id_duct = id_duct.split('.')
        path = os.path.join(os.path.join(self.dir, *id_duct), hash)
        if create:
            ensure_path_exists(os.path.dirname(path))
        return path
github airbnb / omniduct / omniduct / caches / local.py View on Github external
def dir(self):
        """
        str: The path to act as the parent directory for the cache.
        """
        return ensure_path_exists(self._dir)