def get_file_preview(path): path = unquote(path) logging.debug("get_preview %s" % path) path = join(root, path) (preview, orientation) = get_preview(path, return_orientation=True) # Using relpath is very inefficient here, so we don't do it return (preview[len(root):], orientation)
def getattr(self, path, fh=None): logging.debug("getattr %s %s" % (path, fh)) # TODO olvidarnos de la subclase de loop res = super(Raw2Jpeg, self).getattr(self._original(path), fh) full_path = self._full_path(path) if self._ismasked(path): orig = self._original(full_path) try: size = getattr(os.lstat(get_preview(orig)), 'st_size') res['st_size'] = size except: self.blacklist.add(self._original(full_path)) return res
def open(self, path, flags): logging.debug("open %s %s" % (self._full_path(path), flags)) full_path = self._full_path(path) if self._ismasked(full_path): full_path = get_preview(self._original(full_path)) return os.open(full_path, flags)
def get_file_thumb(path): logging.debug("get_file_thumb %s" % path) (thumb, orientation) = get_preview(path, thumbnail=True, return_orientation=True) # Using relpath is very inefficient here, so we don't do it return (thumb[len(root):], orientation)