Ejemplo n.º 1
0
 def readlink(self, pieces):
     # need at least two levels for this to make sense: -2 is the movie dir, -1 is the filename
     if len(pieces) <= 1:
         raise OSError(ENOENT, '')
     else:
         movie = db.movieFromCache(pieces[-2])
         # we have an actual movie selected here - just return its personal directory
         if not movie or movie is None:
             raise OSError(ENOENT, '')
         return os.path.abspath( self.pathbase + '/' + movie.path )
Ejemplo n.º 2
0
 def readlink(self, pieces):
     # need at least two levels for this to make sense: -2 is the movie dir, -1 is the filename
     if len(pieces) <= 1:
         raise OSError(ENOENT, '')
     else:
         movie = db.movieFromCache(pieces[-2])
         # we have an actual movie selected here - just return its personal directory
         if not movie or movie is None:
             raise OSError(ENOENT, '')
         return os.path.abspath(self.pathbase + '/' + movie.path)
Ejemplo n.º 3
0
 def readdir(self, pieces, fh):
     # shouldn't happen - this is typically the case handled by inheriting classes
     if len(pieces) == 0:
         raise OSError(ENOENT, '')
     else:
         # we have an actual movie selected here - just return its personal directory
         movie = db.movieFromCache(pieces[-1])
         if not movie or movie is None:
             raise OSError(ENOENT, '')
         return ['.', '..', os.path.basename(movie.path).replace(os.sep, ' '), 'info' ]
Ejemplo n.º 4
0
 def readdir(self, pieces, fh):
     # shouldn't happen - this is typically the case handled by inheriting classes
     if len(pieces) == 0:
         raise OSError(ENOENT, '')
     else:
         # we have an actual movie selected here - just return its personal directory
         movie = db.movieFromCache(pieces[-1])
         if not movie or movie is None:
             raise OSError(ENOENT, '')
         return [
             '.', '..',
             os.path.basename(movie.path).replace(os.sep, ' '), 'info'
         ]
Ejemplo n.º 5
0
 def read(self, pieces, size, offset, fh=None):
     if len(pieces) <= 1 or pieces[-1] != 'info':
         raise OSError(ENOENT, '')
     movie = db.movieFromCache(pieces[-2])
     return movie.printinfo()
Ejemplo n.º 6
0
            # we have an actual movie selected here - just return its personal directory
            if not movie or movie is None:
                raise OSError(ENOENT, '')
            return os.path.abspath(self.pathbase + '/' + movie.path)

    def getattr(self, pieces, fh=None):
        if len(pieces) <= 1:
            # probably a directory.. either way, this is just here for convenience.
            st = {
                'st_mode': S_IFDIR | 0755,
                'st_nlink': 2,
            }
            st['st_ctime'] = st['st_mtime'] = st['st_atime'] = time()
            return st
        else:
            movie = db.movieFromCache(pieces[-2])
            if movie is None or movie is None:
                raise OSError(ENOENT, '')
            if pieces[-1] == 'info':
                # otherwise, it's a symbolic link
                st = {
                    'st_mode': S_IFREG | 0644,
                    'st_size': len(movie.printinfo()),
                    'st_nlink': 1,
                }
                st['st_ctime'] = st['st_mtime'] = st['st_atime'] = time()
                return st
            elif pieces[-1] == os.path.basename(movie.path).replace(
                    os.sep, ' '):
                # otherwise, it's a symbolic link
                st = {
Ejemplo n.º 7
0
 def read(self, pieces, size, offset, fh=None):
     if len(pieces) <= 1 or pieces[-1] != 'info':
         raise OSError(ENOENT, '')
     movie = db.movieFromCache(pieces[-2])
     return movie.printinfo()
Ejemplo n.º 8
0
            # we have an actual movie selected here - just return its personal directory
            if not movie or movie is None:
                raise OSError(ENOENT, '')
            return os.path.abspath( self.pathbase + '/' + movie.path )

    def getattr(self, pieces, fh=None):
        if len(pieces) <= 1:
            # probably a directory.. either way, this is just here for convenience.
            st = {
                'st_mode': S_IFDIR | 0755,
                'st_nlink': 2,
            }
            st['st_ctime'] = st['st_mtime'] = st['st_atime'] = time()
            return st
        else:
            movie = db.movieFromCache(pieces[-2])
            if movie is None or movie is None:
                raise OSError(ENOENT, '')
            if pieces[-1] == 'info':
                # otherwise, it's a symbolic link
                st = {
                    'st_mode': S_IFREG | 0644,
                    'st_size': len(movie.printinfo()),
                    'st_nlink': 1,
                }
                st['st_ctime'] = st['st_mtime'] = st['st_atime'] = time()
                return st
            elif pieces[-1] == os.path.basename(movie.path).replace(os.sep, ' '):
                # otherwise, it's a symbolic link
                st = {
                    'st_mode': S_IFLNK | 0777,