Logo Search packages:      
Sourcecode: calibre version File versions

def calibre::devices::prs500::driver::PRS500::books (   self,
  oncard = False,
  end_session = True 
)

Return a list of ebooks on the device.
@param oncard: If True return a list of ebooks on the storage card,
            otherwise return list of ebooks in main memory of device

@return: L{BookList}

Reimplemented from calibre::devices::interface::DevicePlugin.

Definition at line 814 of file driver.py.

00814                                                    :
        """
        Return a list of ebooks on the device.
        @param oncard: If True return a list of ebooks on the storage card,
                            otherwise return list of ebooks in main memory of device

        @return: L{BookList}
        """
        root = "/Data/media/"
        tfile = TemporaryFile()
        if oncard:
            try:
                self.get_file("a:"+self.CACHE_XML, tfile, end_session=False)
                root = "a:/"
            except PathError:
                try:
                    self.get_file("b:"+self.CACHE_XML, tfile, end_session=False)
                    root = "b:/"
                except PathError:  pass
            if tfile.tell() == 0:
                tfile = None
        else:
            self.get_file(self.MEDIA_XML, tfile, end_session=False)
        bl = BookList(root=root, sfile=tfile)
        paths = bl.purge_corrupted_files()
        for path in paths:
            try:
                self.del_file(path, end_session=False)
            except PathError: # Incase this is a refetch without a sync in between
                continue
        return bl

    @safe
    def remove_books(self, paths, booklists, end_session=True):


Generated by  Doxygen 1.6.0   Back to index