def __init__(self, nibbler): super(FabnetProvider, self).__init__() self.nibbler = nibbler self.cache_fs = CacheFS() self.readonly = False self.__lock = threading.Lock() self.__virtual_resources = {}
class FabnetProvider(DAVProvider): def __init__(self, nibbler): super(FabnetProvider, self).__init__() self.nibbler = nibbler self.cache_fs = CacheFS() self.readonly = False self.__lock = threading.Lock() self.__virtual_resources = {} def getResourceInst(self, path, environ): """Return info dictionary for path. See DAVProvider.getResourceInst() """ self._count_getResourceInst += 1 is_virt = True r_obj = self.cache_fs.get(path) if not r_obj: r_obj = self.nibbler.find(path) if r_obj is None: return None is_virt = False if r_obj.is_dir: return FolderResource(self.nibbler, path, environ, r_obj) return FileResource(self.nibbler, path, environ, r_obj, is_virt)