Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
def dir(self):
"""
str: The path to act as the parent directory for the cache.
"""
return ensure_path_exists(self._dir)