From 12cb8b2e5818d7014e4ef17c60653741cc062a38 Mon Sep 17 00:00:00 2001 From: un-pogaz <46523284+un-pogaz@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:14:16 +0100 Subject: [PATCH] upgrade hidden print to Python 3 (extra-edit) --- recipes/am730.recipe | 4 +- recipes/el_pais_uy.recipe | 2 +- recipes/medscape.recipe | 2 +- recipes/ourdailybread.recipe | 2 +- recipes/presse_portal.recipe | 2 +- recipes/the_marker.recipe | 2 +- setup/hosting.py | 8 +-- src/calibre/devices/kindle/bookmark.py | 12 ++-- src/calibre/devices/kobo/bookmark.py | 2 +- src/calibre/devices/kobo/driver.py | 60 +++++++++---------- src/calibre/devices/usbms/driver.py | 2 +- src/calibre/ebooks/chm/reader.py | 4 +- src/calibre/ebooks/conversion/utils.py | 24 ++++---- src/calibre/ebooks/djvu/djvu.py | 2 +- src/calibre/ebooks/lrf/pylrs/pylrf.py | 4 +- src/calibre/ebooks/lrf/pylrs/pylrs.py | 4 +- src/calibre/ebooks/metadata/book/render.py | 2 +- src/calibre/ebooks/metadata/topaz.py | 2 +- src/calibre/ebooks/mobi/reader/headers.py | 4 +- src/calibre/ebooks/rtf2xml/hex_2_utf8.py | 6 +- src/calibre/ebooks/rtf2xml/options_trem.py | 20 +++---- src/calibre/ebooks/rtf2xml/table.py | 2 +- src/calibre/ebooks/rtf2xml/tokenize.py | 2 +- src/calibre/gui2/comments_editor.py | 6 +- .../gui2/device_drivers/mtp_folder_browser.py | 2 +- .../gui2/markdown_syntax_highlighter.py | 2 +- src/calibre/gui2/tag_browser/model.py | 4 +- src/calibre/library/caches.py | 2 +- .../library/catalogs/epub_mobi_builder.py | 10 ++-- src/calibre/library/database2.py | 24 ++++---- src/calibre/utils/mdns.py | 6 +- src/calibre/web/feeds/templates.py | 4 +- 32 files changed, 117 insertions(+), 117 deletions(-) diff --git a/recipes/am730.recipe b/recipes/am730.recipe index 0d79189cbf..f5bf33d378 100644 --- a/recipes/am730.recipe +++ b/recipes/am730.recipe @@ -53,7 +53,7 @@ class AM730(BasicNewsRecipe): return self.masthead_url def getAMSectionArticles(self, sectionName,url): - # print sectionName + # print(sectionName) soup = self.index_to_soup(url) articles = [] for aTag in soup.findAll('a',attrs={'class':'newsimglink'}): @@ -67,7 +67,7 @@ class AM730(BasicNewsRecipe): print(title) try: if articles.index({'title':title,'url':href})>=0: - # print 'already added' + # print('already added') continue # already added except: pass diff --git a/recipes/el_pais_uy.recipe b/recipes/el_pais_uy.recipe index 04a5e6f11c..47be554529 100644 --- a/recipes/el_pais_uy.recipe +++ b/recipes/el_pais_uy.recipe @@ -66,7 +66,7 @@ class General(BasicNewsRecipe): index = 'https://www.elpais.com.uy/impresa/' soup = self.index_to_soup(index) link_item = soup.find('a', attrs={'class': 'page-link link-module'}) - # print link_item + # print(link_item) if link_item: cover_url = 'https://www.elpais.com.uy' + link_item.get('href') return cover_url diff --git a/recipes/medscape.recipe b/recipes/medscape.recipe index 098f7d54de..68cd93ebd9 100644 --- a/recipes/medscape.recipe +++ b/recipes/medscape.recipe @@ -56,7 +56,7 @@ class MedScrape(BasicNewsRecipe): # the original url is: http://www.medscape.com/viewarticle/728955?src=rss # the print url is: http://www.medscape.com/viewarticle/728955_print print_url = url.partition('?')[0] + '_print' - # print 'the printable version is: ',print_url + # print('the printable version is: ',print_url) return print_url def preprocess_html(self, soup): diff --git a/recipes/ourdailybread.recipe b/recipes/ourdailybread.recipe index 1bbb87f984..a7a933d5b5 100644 --- a/recipes/ourdailybread.recipe +++ b/recipes/ourdailybread.recipe @@ -66,7 +66,7 @@ class OurDailyBread(BasicNewsRecipe): div.set('class', 'calibre-inserted-psalm') hr = div.makeelement('hr') div.insert(0, hr) - # print html.tostring(div) + # print(html.tostring(div)) raw = html.tostring(root, encoding='unicode') return raw diff --git a/recipes/presse_portal.recipe b/recipes/presse_portal.recipe index e998e33e7c..a6940c9647 100644 --- a/recipes/presse_portal.recipe +++ b/recipes/presse_portal.recipe @@ -142,6 +142,6 @@ class PressePortalDE(BasicNewsRecipe): # and split this at the symbol '.' (if there) : ('3120111',) # from this take the first tuple. '3120111' side = (url.rpartition('/')[-1]).rsplit('.', 1)[0] - # print 'ConvertPrintURL from : ' + url + '/n to ' + side + # print('ConvertPrintURL from : ' + url + '/n to ' + side) printurl = 'http://www.presseportal.de/print/' + side + '-print.html' return printurl diff --git a/recipes/the_marker.recipe b/recipes/the_marker.recipe index 40444777e2..74ae8a0e27 100644 --- a/recipes/the_marker.recipe +++ b/recipes/the_marker.recipe @@ -45,5 +45,5 @@ class AdvancedUserRecipe1283848012(BasicNewsRecipe): rg = re.compile(re1 + re2, re.IGNORECASE | re.DOTALL) m = rg.search(txt) if m: - # print 'bad link' + # print('bad link') return 1 diff --git a/setup/hosting.py b/setup/hosting.py index 2f270ad111..5750dccc0c 100644 --- a/setup/hosting.py +++ b/setup/hosting.py @@ -423,14 +423,14 @@ def upload_to_servers(files, version): # {{{ # print('Uploading to server:', server) # server = '%s.calibre-ebook.com' % server # # Copy the generated index files - # print ('Copying generated index') + # print('Copying generated index') # check_call(['rsync', '-hza', '-e', 'ssh -x', '--include', '*.html', # '--filter', '-! */', base, 'root@%s:%s' % (server, rdir)]) # # Copy the release files # rdir = '%s%s/' % (rdir, version) # for x in files: # start = time.time() - # print ('Uploading', x) + # print('Uploading', x) # for i in range(5): # try: # check_call(['rsync', '-h', '-z', '--progress', '-e', 'ssh -x', x, @@ -438,11 +438,11 @@ def upload_to_servers(files, version): # {{{ # except KeyboardInterrupt: # raise SystemExit(1) # except: - # print ('\nUpload failed, trying again in 30 seconds') + # print('\nUpload failed, trying again in 30 seconds') # time.sleep(30) # else: # break - # print ('Uploaded in', int(time.time() - start), 'seconds\n\n') + # print('Uploaded in', int(time.time() - start), 'seconds\n\n') # diff --git a/src/calibre/devices/kindle/bookmark.py b/src/calibre/devices/kindle/bookmark.py index 72fdf61dea..61ddeda76d 100644 --- a/src/calibre/devices/kindle/bookmark.py +++ b/src/calibre/devices/kindle/bookmark.py @@ -61,11 +61,11 @@ class Bookmark: # {{{ bpl = bpar_offset + 4 bpar_len, = unpack('>I', data[bpl:bpl+4]) bpar_len += 8 - # print 'bpar_len: 0x%x' % bpar_len + # print('bpar_len: 0x%x' % bpar_len) eo = bpar_offset + bpar_len # Walk bookmark entries - # print ' --- %s --- ' % self.path + # print(' --- %s --- ' % self.path) current_entry = 1 sig = data[eo:eo+4] previous_block = None @@ -80,7 +80,7 @@ class Bookmark: # {{{ current_block = 'data_header' # entry_type = "data_header" location, = unpack('>I', data[eo+0x34:eo+0x38]) - # print 'data_header location: %d' % location + # print('data_header location: %d' % location) else: current_block = 'text_block' if previous_block == 'empty_data': @@ -112,11 +112,11 @@ class Bookmark: # {{{ start, = unpack('>I', data[eo+8:eo+12]) user_notes[start] = user_notes[end_loc] ''' - print " %s: swapping 0x%x (%d) to 0x%x (%d)" % (user_notes[end_loc]['type'], + print(" %s: swapping 0x%x (%d) to 0x%x (%d)" % (user_notes[end_loc]['type'], end_loc, end_loc/MAGIC_MOBI_CONSTANT + 1, start, - start//MAGIC_MOBI_CONSTANT + 1) + start//MAGIC_MOBI_CONSTANT + 1)) ''' user_notes[start]['displayed_location'] = start // MAGIC_MOBI_CONSTANT + 1 user_notes.pop(end_loc) @@ -125,7 +125,7 @@ class Bookmark: # {{{ # be the same - cheat by nudging -1 # Skip bookmark for last_read_location if end_loc != self.last_read: - # print ' adding Bookmark at 0x%x (%d)' % (end_loc, end_loc/MAGIC_MOBI_CONSTANT + 1) + # print(' adding Bookmark at 0x%x (%d)' % (end_loc, end_loc/MAGIC_MOBI_CONSTANT + 1)) displayed_location = end_loc // MAGIC_MOBI_CONSTANT + 1 user_notes[end_loc - 1] = dict(id=self.id, displayed_location=displayed_location, diff --git a/src/calibre/devices/kobo/bookmark.py b/src/calibre/devices/kobo/bookmark.py index e7739ae3f5..a2f164d9f4 100644 --- a/src/calibre/devices/kobo/bookmark.py +++ b/src/calibre/devices/kobo/bookmark.py @@ -149,7 +149,7 @@ class Bookmark: # {{{ for row in cursor: self.last_read = row['DateLastRead'] self.percent_read = 100 if (row['ReadStatus'] == 2) else row['___PercentRead'] - # print row[1] + # print(row[1]) cursor.close() # self.last_read_location = self.last_read - self.pdf_page_offset diff --git a/src/calibre/devices/kobo/driver.py b/src/calibre/devices/kobo/driver.py index fdfa3ea679..17116df386 100644 --- a/src/calibre/devices/kobo/driver.py +++ b/src/calibre/devices/kobo/driver.py @@ -321,7 +321,7 @@ class KOBO(USBMS): playlist_map[lpath].append('Recommendation') path = self.normalize_path(path) - # print 'Normalized FileName: ' + path + # print('Normalized FileName: ' + path) idx = bl_cache.get(lpath, None) if idx is not None: @@ -332,7 +332,7 @@ class KOBO(USBMS): # Try the Touch version if the image does not exist imagename = self.normalize_path(self._main_prefix + KOBO_ROOT_DIR_NAME + '/images/' + ImageID + ' - N3_LIBRARY_FULL.parsed') - # print 'Image name Normalized: ' + imagename + # print('Image name Normalized: ' + imagename) if not os.path.exists(imagename): debug_print('Strange - The image name does not exist - title: ', title) if imagename is not None: @@ -340,7 +340,7 @@ class KOBO(USBMS): if (ContentType != '6' and MimeType != 'Shortcover'): if os.path.exists(self.normalize_path(os.path.join(prefix, lpath))): if self.update_metadata_item(bl[idx]): - # print 'update_metadata_item returned true' + # print('update_metadata_item returned true') changed = True else: debug_print(' Strange: The file: ', prefix, lpath, ' does not exist!') @@ -364,7 +364,7 @@ class KOBO(USBMS): 'mime: ', mime, 'date: ', date, 'ContentType: ', ContentType, 'ImageID: ', ImageID) raise - # print 'Update booklist' + # print('Update booklist') book.device_collections = playlist_map.get(lpath,[]) # if lpath in playlist_map else [] if bl.add_book(book, replace_metadata=False): @@ -452,8 +452,8 @@ class KOBO(USBMS): need_sync = True del bl[idx] - # print 'count found in cache: %d, count of files in metadata: %d, need_sync: %s' % \ - # (len(bl_cache), len(bl), need_sync) + # print('count found in cache: %d, count of files in metadata: %d, need_sync: %s' % \ + # (len(bl_cache), len(bl), need_sync)) if need_sync: # self.count_found_in_bl != len(bl) or need_sync: if oncard == 'cardb': self.sync_booklists((None, None, bl)) @@ -551,7 +551,7 @@ class KOBO(USBMS): fpath = self.normalize_path(fpath) if os.path.exists(fpath): - # print 'Image File Exists: ' + fpath + # print('Image File Exists: ' + fpath) os.unlink(fpath) def delete_books(self, paths, end_session=True): @@ -561,33 +561,33 @@ class KOBO(USBMS): for i, path in enumerate(paths): self.report_progress((i+1) / float(len(paths)), _('Removing books from device...')) path = self.normalize_path(path) - # print 'Delete file normalized path: ' + path + # print('Delete file normalized path: ' + path) extension = os.path.splitext(path)[1] ContentType = self.get_content_type_from_extension(extension) if extension else self.get_content_type_from_path(path) ContentID = self.contentid_from_path(path, ContentType) ImageID = self.delete_via_sql(ContentID, ContentType) - # print ' We would now delete the Images for' + ImageID + # print(' We would now delete the Images for' + ImageID) self.delete_images(ImageID, path) if os.path.exists(path): # Delete the ebook - # print 'Delete the ebook: ' + path + # print('Delete the ebook: ' + path) os.unlink(path) filepath = os.path.splitext(path)[0] for ext in self.DELETE_EXTS: if os.path.exists(filepath + ext): - # print 'Filename: ' + filename + # print('Filename: ' + filename) os.unlink(filepath + ext) if os.path.exists(path + ext): - # print 'Filename: ' + filename + # print('Filename: ' + filename) os.unlink(path + ext) if self.SUPPORTS_SUB_DIRS: try: - # print 'removed' + # print('removed') os.removedirs(os.path.dirname(path)) except Exception: pass @@ -601,9 +601,9 @@ class KOBO(USBMS): self.report_progress((i+1) / float(len(paths)), _('Removing books from device metadata listing...')) for bl in booklists: for book in bl: - # print 'Book Path: ' + book.path + # print('Book Path: ' + book.path) if path.endswith(book.path): - # print ' Remove: ' + book.path + # print(' Remove: ' + book.path) bl.remove_book(book) self.report_progress(1.0, _('Removing books from device metadata listing...')) @@ -634,12 +634,12 @@ class KOBO(USBMS): prints('in add_books_to_metadata. Prefix is None!', path, self._main_prefix) continue - # print 'Add book to metadata: ' - # print 'prefix: ' + prefix + # print('Add book to metadata: ') + # print('prefix: ' + prefix) lpath = path.partition(prefix)[2] if lpath.startswith('/') or lpath.startswith('\\'): lpath = lpath[1:] - # print 'path: ' + lpath + # print('path: ' + lpath) book = self.book_class(prefix, lpath, info.title, other=info) if book.size is None or book.size == 0: book.size = os.stat(self.normalize_path(path)).st_size @@ -686,13 +686,13 @@ class KOBO(USBMS): def get_content_type_from_extension(self, extension): if extension == '.kobo': # Kobo books do not have book files. They do have some images though - # print 'kobo book' + # print('kobo book') ContentType = 6 elif extension == '.pdf' or extension == '.epub': - # print 'ePub or pdf' + # print('ePub or pdf') ContentType = 16 elif extension == '.rtf' or extension == '.txt' or extension == '.htm' or extension == '.html': - # print 'txt' + # print('txt') if self.fwversion == (1,0) or self.fwversion == (1,4) or self.fwversion == (1,7,4): ContentType = 999 else: @@ -708,14 +708,14 @@ class KOBO(USBMS): print('path from_contentid cardb') elif oncard == 'carda': path = path.replace('file:///mnt/sd/', self._card_a_prefix) - # print 'SD Card: ' + path + # print('SD Card: ' + path) else: if ContentType == '6' and MimeType == 'Shortcover': # This is a hack as the kobo files do not exist # but the path is required to make a unique id # for calibre's reference path = self._main_prefix + path + '.kobo' - # print 'Path: ' + path + # print('Path: ' + path) elif (ContentType == '6' or ContentType == '10') and ( MimeType == 'application/x-kobo-epub+zip' or ( MimeType == 'application/epub+zip' and self.isTolinoDevice()) @@ -724,12 +724,12 @@ class KOBO(USBMS): path = self._main_prefix + path.replace('file:///mnt/onboard/', '') else: path = self._main_prefix + KOBO_ROOT_DIR_NAME + '/kepub/' + path - # print 'Internal: ' + path + # print('Internal: ' + path) else: # if path.startswith('file:///mnt/onboard/'): path = path.replace('file:///mnt/onboard/', self._main_prefix) path = path.replace('/mnt/onboard/', self._main_prefix) - # print 'Internal: ' + path + # print('Internal: ' + path) return path @@ -1820,7 +1820,7 @@ class KOBOTOUCH(KOBO): debug_print('KoboTouch:update_booklist - playlist_map=', playlist_map) path = self.normalize_path(path) - # print 'Normalized FileName: ' + path + # print('Normalized FileName: ' + path) # Collect the Kobo metadata authors_list = [a.strip() for a in authors.split('&')] if authors is not None else [_('Unknown')] @@ -1929,7 +1929,7 @@ class KOBOTOUCH(KOBO): debug_print(' bookshelves:', bookshelves) debug_print(' kobo_collections:', kobo_collections) - # print 'Update booklist' + # print('Update booklist') book.device_collections = playlist_map.get(lpath,[]) # if lpath in playlist_map else [] book.current_shelves = bookshelves book.kobo_collections = kobo_collections @@ -2144,8 +2144,8 @@ class KOBOTOUCH(KOBO): else: debug_print("KoboTouch:books - Book in mtadata.calibre, on file system but not database - bl[idx].title:'%s'"%bl[idx].title) - # print 'count found in cache: %d, count of files in metadata: %d, need_sync: %s' % \ - # (len(bl_cache), len(bl), need_sync) + # print('count found in cache: %d, count of files in metadata: %d, need_sync: %s' % \ + # (len(bl_cache), len(bl), need_sync)) # Bypassing the KOBO sync_booklists as that does things we don't need to do # Also forcing sync to see if this solves issues with updating shelves and matching books. if need_sync or True: # self.count_found_in_bl != len(bl) or need_sync: @@ -2208,7 +2208,7 @@ class KOBOTOUCH(KOBO): path = path.replace('file:///mnt/onboard/', self._main_prefix) path = path.replace('file:///mnt/sd/', self._card_a_prefix) path = path.replace('/mnt/onboard/', self._main_prefix) - # print 'Internal: ' + path + # print('Internal: ' + path) return path diff --git a/src/calibre/devices/usbms/driver.py b/src/calibre/devices/usbms/driver.py index 20ff03b326..1dba28aa3b 100644 --- a/src/calibre/devices/usbms/driver.py +++ b/src/calibre/devices/usbms/driver.py @@ -247,7 +247,7 @@ class USBMS(CLI, Device): if idx is not None: bl_cache[lpath] = None if self.update_metadata_item(bl[idx]): - # print 'update_metadata_item returned true' + # print('update_metadata_item returned true') changed = True else: if bl.add_book(self.book_from_path(prefix, lpath), diff --git a/src/calibre/ebooks/chm/reader.py b/src/calibre/ebooks/chm/reader.py index 2d6607eddc..4bf7b2d4e0 100644 --- a/src/calibre/ebooks/chm/reader.py +++ b/src/calibre/ebooks/chm/reader.py @@ -141,14 +141,14 @@ class CHMReader(CHMFile): else: frag = None name = self._deentity(li.object('param', {'name': 'Name'})[0]['value']) - # print '========>', name + # print('========>', name) toc.add_item(href, frag, name, play_order=self._playorder) self._playorder += 1 if li.ul: child = self._parse_toc(li.ul) child.parent = toc toc.append(child) - # print toc + # print(toc) return toc def ResolveObject(self, path): diff --git a/src/calibre/ebooks/conversion/utils.py b/src/calibre/ebooks/conversion/utils.py index 28184f8330..d31e601dc0 100644 --- a/src/calibre/ebooks/conversion/utils.py +++ b/src/calibre/ebooks/conversion/utils.py @@ -628,7 +628,7 @@ class HeuristicProcessor: def check_paragraph(self, content): content = re.sub('\\s*?span[^>]*>\\s*', '', content) if re.match('.*["\'.!?:]$', content): - # print 'detected this as a paragraph' + # print('detected this as a paragraph') return True else: return False @@ -641,9 +641,9 @@ class HeuristicProcessor: html = re.sub('?a[^>]*>', '', html) def convert_styles(match): - # print 'raw styles are: '+match.group('styles') + # print('raw styles are: '+match.group('styles')) content = match.group('content') - # print 'raw content is: '+match.group('content') + # print('raw content is: '+match.group('content')) image = match.group('image') is_paragraph = False @@ -668,12 +668,12 @@ class HeuristicProcessor: else: styles = match.group('styles').split(';') is_paragraph = self.check_paragraph(content) - # print 'styles for this line are: '+str(styles) + # print('styles for this line are: '+str(styles)) split_styles = [] for style in styles: - # print 'style is: '+str(style) + # print('style is: '+str(style)) newstyle = style.split(':') - # print 'newstyle is: '+str(newstyle) + # print('newstyle is: '+str(newstyle)) split_styles.append(newstyle) styles = split_styles for style, setting in styles: @@ -710,18 +710,18 @@ class HeuristicProcessor: self.log.debug('padding bottom is: ' + str(setting[2])) self.log.debug('padding left is: ' +str(setting[3])) - # print 'text-align is: '+str(text_align) - # print '\n***\nline is:\n '+str(match.group(0))+'\n' + # print('text-align is: '+str(text_align)) + # print('\n***\nline is:\n '+str(match.group(0))+'\n') if debugabby: - # print 'this line is a paragraph = '+str(is_paragraph)+', previous line was '+str(self.previous_was_paragraph) + # print('this line is a paragraph = '+str(is_paragraph)+', previous line was '+str(self.previous_was_paragraph)) self.log.debug('styles for this line were:', styles) self.log.debug('newline is:') self.log.debug(blockquote_open_loop+blockquote_close_loop+ paragraph_before+'
'+content+'
'+paragraph_after+'\n\n\n\n\n') - # print 'is_paragraph is '+str(is_paragraph)+', previous_was_paragraph is '+str(self.previous_was_paragraph) + # print('is_paragraph is '+str(is_paragraph)+', previous_was_paragraph is '+str(self.previous_was_paragraph)) self.previous_was_paragraph = is_paragraph - # print 'previous_was_paragraph is now set to '+str(self.previous_was_paragraph)+'\n\n\n' + # print('previous_was_paragraph is now set to '+str(self.previous_was_paragraph)+'\n\n\n') return blockquote_open_loop+blockquote_close_loop+paragraph_before+''+content+'
'+paragraph_after html = abbyy_line.sub(convert_styles, html) @@ -772,7 +772,7 @@ class HeuristicProcessor: self.line_close = '\\s*([ibu][^>]*>\\s*)?(?P=outer)>' # ADE doesn't render\u00a0
', html) + # html = re.sub('\u00a0
', html) # Determine whether the document uses interleaved blank lines self.blanks_between_paragraphs = self.analyze_blanks(html) diff --git a/src/calibre/ebooks/djvu/djvu.py b/src/calibre/ebooks/djvu/djvu.py index df029e5de9..a071517983 100644 --- a/src/calibre/ebooks/djvu/djvu.py +++ b/src/calibre/ebooks/djvu/djvu.py @@ -37,7 +37,7 @@ class DjvuChunk: self.dataend = pos + self.size - (8 if inclheader else 0) if self.type == b'FORM': oldpos, pos = pos, pos+4 - # print oldpos, pos + # print(oldpos, pos) self.subtype = buf[oldpos:pos] # self.headersize += 4 self.datastart = pos diff --git a/src/calibre/ebooks/lrf/pylrs/pylrf.py b/src/calibre/ebooks/lrf/pylrs/pylrf.py index 4d23412d62..6a5e10a612 100644 --- a/src/calibre/ebooks/lrf/pylrs/pylrf.py +++ b/src/calibre/ebooks/lrf/pylrs/pylrf.py @@ -397,7 +397,7 @@ class LrfTag: if p is None: return - # print ' Writing tag', self.name + # print(' Writing tag', self.name) for f in self.format: if isinstance(f, dict): p = f[p] @@ -565,7 +565,7 @@ class LrfObject: dotscode))) def write(self, lrf, encoding=None): - # print 'Writing object', self.name + # print('Writing object', self.name) LrfTag('ObjectStart', (self.objId, self.type)).write(lrf) for tag in self.tags: diff --git a/src/calibre/ebooks/lrf/pylrs/pylrs.py b/src/calibre/ebooks/lrf/pylrs/pylrs.py index d045936465..4594295730 100644 --- a/src/calibre/ebooks/lrf/pylrs/pylrs.py +++ b/src/calibre/ebooks/lrf/pylrs/pylrs.py @@ -1344,7 +1344,7 @@ class Page(LrsObject, LrsContainer): if hasattr(content, 'getReferencedObjIds'): pageContent.update(content.getReferencedObjIds()) - # print 'page contents:', pageContent + # print('page contents:', pageContent) # ObjectList not needed and causes slowdown in SONY LRF renderer # p.appendLrfTag(LrfTag("ObjectList", pageContent)) p.appendLrfTag(LrfTag('Link', self.pageStyle.objId)) @@ -1620,7 +1620,7 @@ class Button(LrsObject, LrsContainer): def toLrf(self, lrfWriter): (refobj, refpage) = self.findJumpToRefs() - # print 'Button writing JumpTo refobj=', jumpto.refobj, ', and refpage=', jumpto.refpage + # print('Button writing JumpTo refobj=', jumpto.refobj, ', and refpage=', jumpto.refpage) button = LrfObject('Button', self.objId) button.appendLrfTag(LrfTag('buttonflags', 0x10)) # pushbutton button.appendLrfTag(LrfTag('PushButtonStart')) diff --git a/src/calibre/ebooks/metadata/book/render.py b/src/calibre/ebooks/metadata/book/render.py index b2e06ad14b..6781ab3f94 100644 --- a/src/calibre/ebooks/metadata/book/render.py +++ b/src/calibre/ebooks/metadata/book/render.py @@ -439,7 +439,7 @@ def mi_to_html( ans = ['