diff --git a/src/calibre/customize/profiles.py b/src/calibre/customize/profiles.py index 1563f764ca..2b5eb5011e 100644 --- a/src/calibre/customize/profiles.py +++ b/src/calibre/customize/profiles.py @@ -248,6 +248,9 @@ class OutputProfile(Plugin): #: If True, the date is appended to the title of downloaded news periodical_date_in_title = True + #: The character used to represent a star in ratings + ratings_char = u'*' + @classmethod def tags_to_string(cls, tags): return escape(', '.join(tags)) @@ -273,6 +276,7 @@ class iPadOutput(OutputProfile): 'macros': {'border-width': '{length}|medium|thick|thin'} } ] + ratings_char = u'\u2605' touchscreen = True # touchscreen_news_css {{{ touchscreen_news_css = u''' @@ -553,10 +557,11 @@ class KindleOutput(OutputProfile): fsizes = [12, 12, 14, 16, 18, 20, 22, 24] supports_mobi_indexing = True periodical_date_in_title = False + ratings_char = u'\u2605' @classmethod def tags_to_string(cls, tags): - return u'%s
%s' % (', '.join(tags), + return u'%s
%s' % (', '.join(tags), 'ttt '.join(tags)+'ttt ') class KindleDXOutput(OutputProfile): diff --git a/src/calibre/devices/apple/driver.py b/src/calibre/devices/apple/driver.py index da286bcc6e..608171bc1f 100644 --- a/src/calibre/devices/apple/driver.py +++ b/src/calibre/devices/apple/driver.py @@ -208,8 +208,8 @@ class ITUNES(DriverBase): for (j,p_book) in enumerate(self.update_list): if False: if isosx: - self.log.info(" looking for %s" % - str(p_book['lib_book'])[-9:]) + self.log.info(" looking for '%s' by %s uuid:%s" % + (p_book['title'],p_book['author'], p_book['uuid'])) elif iswindows: self.log.info(" looking for '%s' by %s (%s)" % (p_book['title'],p_book['author'], p_book['uuid'])) @@ -304,7 +304,7 @@ class ITUNES(DriverBase): this_book.device_collections = [] this_book.library_id = library_books[this_book.path] if this_book.path in library_books else None this_book.size = book.size() - this_book.uuid = book.album() + this_book.uuid = book.composer() # Hack to discover if we're running in GUI environment if self.report_progress is not None: this_book.thumbnail = self._generate_thumbnail(this_book.path, book) @@ -733,15 +733,15 @@ class ITUNES(DriverBase): for path in paths: if DEBUG: self._dump_cached_book(self.cached_books[path], indent=2) - self.log.info(" looking for '%s' by '%s' (%s)" % + self.log.info(" looking for '%s' by '%s' uuid:%s" % (self.cached_books[path]['title'], self.cached_books[path]['author'], self.cached_books[path]['uuid'])) # Purge the booklist, self.cached_books, thumb cache for i,bl_book in enumerate(booklists[0]): - if False: - self.log.info(" evaluating '%s' by '%s' (%s)" % + if DEBUG: + self.log.info(" evaluating '%s' by '%s' uuid:%s" % (bl_book.title, bl_book.author,bl_book.uuid)) found = False @@ -782,10 +782,10 @@ class ITUNES(DriverBase): zf.close() break -# else: -# if DEBUG: -# self.log.error(" unable to find '%s' by '%s' (%s)" % -# (bl_book.title, bl_book.author,bl_book.uuid)) + else: + if DEBUG: + self.log.error(" unable to find '%s' by '%s' (%s)" % + (bl_book.title, bl_book.author,bl_book.uuid)) if False: self._dump_booklist(booklists[0], indent = 2) @@ -906,7 +906,8 @@ class ITUNES(DriverBase): # Add new_book to self.cached_books if DEBUG: - self.log.info(" adding '%s' by '%s' ['%s'] to self.cached_books" % + self.log.info("ITUNES.upload_books()") + self.log.info(" adding '%s' by '%s' uuid:%s to self.cached_books" % ( metadata[i].title, metadata[i].author, metadata[i].uuid)) self.cached_books[this_book.path] = { 'author': metadata[i].author, @@ -944,7 +945,11 @@ class ITUNES(DriverBase): new_booklist.append(this_book) self._update_iTunes_metadata(metadata[i], db_added, lb_added, this_book) - # Add new_book to self.cached_paths + # Add new_book to self.cached_books + if DEBUG: + self.log.info("ITUNES.upload_books()") + self.log.info(" adding '%s' by '%s' uuid:%s to self.cached_books" % + ( metadata[i].title, metadata[i].author, metadata[i].uuid)) self.cached_books[this_book.path] = { 'author': metadata[i].author[0], 'dev_book': db_added, @@ -1407,8 +1412,8 @@ class ITUNES(DriverBase): for book in booklist: if isosx: - self.log.info("%s%-40.40s %-30.30s %-10.10s" % - (' '*indent,book.title, book.author, str(book.library_id)[-9:])) + self.log.info("%s%-40.40s %-30.30s %-10.10s %s" % + (' '*indent,book.title, book.author, str(book.library_id)[-9:], book.uuid)) elif iswindows: self.log.info("%s%-40.40s %-30.30s" % (' '*indent,book.title, book.author)) @@ -1548,11 +1553,12 @@ class ITUNES(DriverBase): if isosx: for ub in self.update_list: - self.log.info("%s%-40.40s %-30.30s %-10.10s" % + self.log.info("%s%-40.40s %-30.30s %-10.10s %s" % (' '*indent, ub['title'], ub['author'], - str(ub['lib_book'])[-9:])) + str(ub['lib_book'])[-9:], + ub['uuid'])) elif iswindows: for ub in self.update_list: self.log.info("%s%-40.40s %-30.30s" % @@ -2805,7 +2811,7 @@ class ITUNES_ASYNC(ITUNES): #this_book.library_id = library_books[this_book.path] if this_book.path in library_books else None this_book.library_id = library_books[book] this_book.size = library_books[book].size() - this_book.uuid = library_books[book].album() + this_book.uuid = library_books[book].composer() # Hack to discover if we're running in GUI environment if self.report_progress is not None: this_book.thumbnail = self._generate_thumbnail(this_book.path, library_books[book]) @@ -2845,6 +2851,7 @@ class ITUNES_ASYNC(ITUNES): this_book.device_collections = [] this_book.library_id = library_books[book] this_book.size = library_books[book].Size + this_book.uuid = library_books[book].Composer # Hack to discover if we're running in GUI environment if self.report_progress is not None: this_book.thumbnail = self._generate_thumbnail(this_book.path, library_books[book]) diff --git a/src/calibre/ebooks/oeb/transforms/jacket.py b/src/calibre/ebooks/oeb/transforms/jacket.py index a44a18db95..88c7a4ff0e 100644 --- a/src/calibre/ebooks/oeb/transforms/jacket.py +++ b/src/calibre/ebooks/oeb/transforms/jacket.py @@ -93,7 +93,7 @@ class Jacket(object): # Render Jacket {{{ -def get_rating(rating): +def get_rating(rating, rchar): ans = '' try: num = float(rating)/2 @@ -104,7 +104,7 @@ def get_rating(rating): if num < 1: return ans - ans = u'\u2605' * int(num) + ans = rchar * int(num) return ans @@ -129,7 +129,7 @@ def render_jacket(mi, output_profile, except: pubdate = '' - rating = get_rating(mi.rating) + rating = get_rating(mi.rating, output_profile.ratings_char) tags = mi.tags if mi.tags else alt_tags if tags: diff --git a/src/calibre/gui2/convert/structure_detection.ui b/src/calibre/gui2/convert/structure_detection.ui index eb2892a07a..c0b3de3bd9 100644 --- a/src/calibre/gui2/convert/structure_detection.ui +++ b/src/calibre/gui2/convert/structure_detection.ui @@ -41,24 +41,17 @@ - + Insert &metadata as page at start of book - - - - &Preprocess input file to possibly improve structure detection - - - - + - + Qt::Vertical @@ -71,26 +64,33 @@ - + Remove F&ooter - + Remove H&eader - + - + + + + + &Preprocess input file to possibly improve structure detection + + +