'Delete books at paths on device.
iTunes doesn\'t let us directly delete a book on the device.
If the requested paths are deletable (i.e., it\'s in the Library|Books list),
delete the paths from the library, then resync iPad'

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

    self.problem_titles = []
    self.problem_msg = _("Some    books    not    found    in    iTunes    database.\nDelete    using    the    iBooks    app.\nClick    'Show    details'    for    a    list.")
    logger().info(('%s.delete_books()' % self.__class__.__name__))
    for path in paths:
        if self.cached_books[path]['lib_book']:
            if self.verbose:
                logger().info(("    Deleting    '%s'    from    iTunes    library" % path))
            if isosx:
                self._remove_from_iTunes(self.cached_books[path])
                if self.manual_sync_mode:
                    self._remove_from_device(self.cached_books[path])
            elif iswindows:
                import pythoncom, win32com.client
                try:
                    pythoncom.CoInitialize()
                    self.iTunes = win32com.client.Dispatch('iTunes.Application')
                    self._remove_from_iTunes(self.cached_books[path])
                    if self.manual_sync_mode:
                        self._remove_from_device(self.cached_books[path])
                finally:
                    pythoncom.CoUninitialize()
            if (not self.manual_sync_mode):
                self.update_needed = True
                self.update_msg = 'Deleted    books    from    device'
            else:
                logger().info('    skipping    sync    phase,    manual_sync_mode:    True')
        elif self.manual_sync_mode:
            metadata = MetaInformation(self.cached_books[path]['title'], self.cached_books[path]['authors'])
            metadata.author = self.cached_books[path]['author']
            metadata.uuid = self.cached_books[path]['uuid']
            if (not metadata.uuid):
                metadata.uuid = 'unknown'
            if self.verbose:
                logger().info(("    Deleting    '%s'    from    iBooks" % path))
            if isosx:
                self._remove_existing_copy(self.cached_books[path], metadata)
            elif iswindows:
                import pythoncom, win32com.client
                try:
                    pythoncom.CoInitialize()
                    self.iTunes = win32com.client.Dispatch('iTunes.Application')
                    self._remove_existing_copy(self.cached_books[path], metadata)
                finally:
                    pythoncom.CoUninitialize()
        else:
            self.problem_titles.append(("'%s'    by    %s" % (self.cached_books[path]['title'], self.cached_books[path]['author'])))
