Logo Search packages:      
Sourcecode: calibre version File versions

def calibre::devices::prs500::driver::PRS500::add_books_to_metadata (   cls,
  locations,
  metadata,
  booklists 
)

Add locations to the booklists. This function must not communicate with
the device.
@param locations: Result of a call to L{upload_books}
@param metadata: List of dictionaries. Each dictionary must have the
keys C{title}, C{authors}, C{author_sort}, C{cover}, C{tags}.
The value of the C{cover}
element can be None or a three element tuple (width, height, data)
where data is the image data in JPEG format as a string. C{tags} must be
a possibly empty list of strings. C{authors} must be a string.
C{author_sort} may be None. It is upto the driver to decide whether to
use C{author_sort} or not.
The dictionary can also have an optional key "tag order" which should be
another dictionary that maps tag names to lists of book ids. The ids are
ids from the book database.
@param booklists: A tuple containing the result of calls to
                (L{books}(oncard=None), L{books}(oncard='carda'),
                L{books}(oncard='cardb')).

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

Definition at line 901 of file driver.py.

00901                                                                   :
        metadata = iter(metadata)
        for location in locations:
            info = metadata.next()
            path = location[0]
            on_card = 1 if path[1] == ':' else 0
            name = path.rpartition('/')[2]
            name = (cls.CARD_PATH_PREFIX+'/' if on_card else 'books/') + name
            booklists[on_card].add_book(info, name, *location[1:])
        fix_ids(*booklists)

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


Generated by  Doxygen 1.6.0   Back to index