diff --git a/recipes/am730.recipe b/recipes/am730.recipe index 9b87b779a4..d5114f119e 100644 --- a/recipes/am730.recipe +++ b/recipes/am730.recipe @@ -78,7 +78,7 @@ class AM730(BasicNewsRecipe): break if self.debug: print(articles) - return (sectionName,articles) + return sectionName, articles def parse_index(self): # hard code sections @@ -91,7 +91,7 @@ class AM730(BasicNewsRecipe): ('旅遊.飲食','https://www.am730.com.hk/news/%E6%97%85%E9%81%8A.%E9%A3%B2%E9%A3%9F') ] # articles =[] SectionsArticles=[] - for (title, url) in Sections: + for title, url in Sections: if self.debug: print(title) print(url) diff --git a/recipes/calgary_herald.recipe b/recipes/calgary_herald.recipe index 741f507811..b9e3f145ba 100644 --- a/recipes/calgary_herald.recipe +++ b/recipes/calgary_herald.recipe @@ -309,7 +309,7 @@ class CanWestPaper(BasicNewsRecipe): for wdiv in mainsoup.findAll(attrs={'class': ['headline', 'featurecontent']}): handle_article(wdiv, key) - for (k, url) in self.postmedia_index_pages: + for k,url in self.postmedia_index_pages: parse_web_index(k, url) ans = [(key, articles[key]) for key in ans if key in articles] return ans diff --git a/recipes/edmonton_journal.recipe b/recipes/edmonton_journal.recipe index ade2091412..a8daaaaecc 100644 --- a/recipes/edmonton_journal.recipe +++ b/recipes/edmonton_journal.recipe @@ -309,7 +309,7 @@ class CanWestPaper(BasicNewsRecipe): for wdiv in mainsoup.findAll(attrs={'class': ['headline', 'featurecontent']}): handle_article(wdiv, key) - for (k, url) in self.postmedia_index_pages: + for k,url in self.postmedia_index_pages: parse_web_index(k, url) ans = [(key, articles[key]) for key in ans if key in articles] return ans diff --git a/recipes/equestria_daily.recipe b/recipes/equestria_daily.recipe index 63d8b48d84..1efeb7bfe1 100644 --- a/recipes/equestria_daily.recipe +++ b/recipes/equestria_daily.recipe @@ -51,7 +51,7 @@ class AdvancedUserRecipe1639926896(BasicNewsRecipe): lines = description.split('\n') return '\n'.join([line.strip() for line in lines if len(line.strip()) > 0]) - for (section_name, section_url_name) in self.sections: + for section_name, section_url_name in self.sections: soup = self.index_to_soup( f'https://www.equestriadaily.com/search/label/{section_url_name}?max-results={self.max_articles_per_feed}') articles = soup.select('div.post.hentry') diff --git a/recipes/grantland.recipe b/recipes/grantland.recipe index ca08c6a03f..8500ea5313 100644 --- a/recipes/grantland.recipe +++ b/recipes/grantland.recipe @@ -47,7 +47,7 @@ class GrantLand(BasicNewsRecipe): for category in self.CATEGORIES: - (cat_name, tag, max_articles) = category + cat_name, tag, max_articles = category self.log('Reading category:', cat_name) articles = [] diff --git a/recipes/il_post.recipe b/recipes/il_post.recipe index 3297ca3de7..9fa8a31638 100644 --- a/recipes/il_post.recipe +++ b/recipes/il_post.recipe @@ -85,7 +85,7 @@ class IlPost(BasicNewsRecipe): 'title': title, 'description': desc }) - return (name, entries) + return name, entries def parse_index(self): feeds = [] diff --git a/recipes/montreal_gazette.recipe b/recipes/montreal_gazette.recipe index bb8b4b25eb..a996244c12 100644 --- a/recipes/montreal_gazette.recipe +++ b/recipes/montreal_gazette.recipe @@ -309,7 +309,7 @@ class CanWestPaper(BasicNewsRecipe): for wdiv in mainsoup.findAll(attrs={'class': ['headline', 'featurecontent']}): handle_article(wdiv, key) - for (k, url) in self.postmedia_index_pages: + for k,url in self.postmedia_index_pages: parse_web_index(k, url) ans = [(key, articles[key]) for key in ans if key in articles] return ans diff --git a/recipes/ottawa_citizen.recipe b/recipes/ottawa_citizen.recipe index 9db1eb7c04..b6134f7b99 100644 --- a/recipes/ottawa_citizen.recipe +++ b/recipes/ottawa_citizen.recipe @@ -309,7 +309,7 @@ class CanWestPaper(BasicNewsRecipe): for wdiv in mainsoup.findAll(attrs={'class': ['headline', 'featurecontent']}): handle_article(wdiv, key) - for (k, url) in self.postmedia_index_pages: + for k,url in self.postmedia_index_pages: parse_web_index(k, url) ans = [(key, articles[key]) for key in ans if key in articles] return ans diff --git a/recipes/the_saturday_paper.recipe b/recipes/the_saturday_paper.recipe index 25eb07d203..53f11435d5 100644 --- a/recipes/the_saturday_paper.recipe +++ b/recipes/the_saturday_paper.recipe @@ -53,7 +53,7 @@ class SaturdayPaper(BasicNewsRecipe): articles = [] - for (feed, link) in feeds: + for feed, link in feeds: soup = self.index_to_soup(link) news = [] diff --git a/recipes/theoldie.recipe b/recipes/theoldie.recipe index 3c6de3a841..3972f50472 100644 --- a/recipes/theoldie.recipe +++ b/recipes/theoldie.recipe @@ -100,10 +100,10 @@ class PrivateEyeRecipe(BasicNewsRecipe): return head.rsplit('. By ', 1) matches = self.title_author_re.findall(head) if matches and len(matches[0]) == 3: - (title_1, author, title_2) = matches[0] + title_1, author, title_2 = matches[0] title = ': '.join((title_1, title_2)) - return (title, author) - return (head, None) + return title, author + return head, None # Return the list of articles from blocks in the content of an index/listing page def parse_content(self, soup): @@ -117,7 +117,7 @@ class PrivateEyeRecipe(BasicNewsRecipe): for article in content.findAll('div', class_='listing-block'): for a in article.findAll('a', href=True): for h in a.findAll('h3'): - (title, author) = self.title_author(h.getText()) + title, author = self.title_author(h.getText()) content_articles.append(self.article_entry( title=title, url=self.abs_url(a.get('href')), @@ -155,7 +155,7 @@ class PrivateEyeRecipe(BasicNewsRecipe): self.log('Subpages found:', href, len(content)) articles.extend(content) else: - (title, author) = self.title_author(a.getText()) + title, author = self.title_author(a.getText()) articles.append(self.article_entry( title=title, url=self.abs_url(a.get('href')), @@ -176,7 +176,7 @@ class PrivateEyeRecipe(BasicNewsRecipe): # 4. The about pages abouts = [] - for (title, url) in self.about_pages.items(): + for title, url in self.about_pages.items(): abouts.append({ 'title': title, 'url': url, @@ -190,7 +190,7 @@ class PrivateEyeRecipe(BasicNewsRecipe): def preprocess_html(self, soup): for h in soup.findAll('h1'): - (title, author) = self.title_author(h.getText()) + title, author = self.title_author(h.getText()) self.log('Replacing h3 "', h.getText(), '" with "', title, '"') h.string = title diff --git a/recipes/vancouver_province.recipe b/recipes/vancouver_province.recipe index a022ea415f..49e4c09d4c 100644 --- a/recipes/vancouver_province.recipe +++ b/recipes/vancouver_province.recipe @@ -322,7 +322,7 @@ class CanWestPaper(BasicNewsRecipe): for wdiv in mainsoup.findAll(attrs={'class': ['headline', 'featurecontent']}): handle_article(wdiv, key) - for (k, url) in self.postmedia_index_pages: + for k,url in self.postmedia_index_pages: parse_web_index(k, url) ans = [(key, articles[key]) for key in ans if key in articles] return ans diff --git a/recipes/vancouver_sun.recipe b/recipes/vancouver_sun.recipe index 0399aa9f00..f123f8b2d6 100644 --- a/recipes/vancouver_sun.recipe +++ b/recipes/vancouver_sun.recipe @@ -310,7 +310,7 @@ class CanWestPaper(BasicNewsRecipe): for wdiv in mainsoup.findAll(attrs={'class': ['headline', 'featurecontent']}): handle_article(wdiv, key) - for (k, url) in self.postmedia_index_pages: + for k,url in self.postmedia_index_pages: parse_web_index(k, url) ans = [(key, articles[key]) for key in ans if key in articles] return ans diff --git a/recipes/vic_times.recipe b/recipes/vic_times.recipe index 7be3e60b17..39e3f918a3 100644 --- a/recipes/vic_times.recipe +++ b/recipes/vic_times.recipe @@ -253,6 +253,6 @@ class TimesColonist(BasicNewsRecipe): def parse_index(self): ans = [] - for (url, title) in self.section_list: + for url, title in self.section_list: ans = self.add_section_index(ans, url, title) return ans diff --git a/recipes/zeitde_sub.recipe b/recipes/zeitde_sub.recipe index d4301dac3b..bb36ab6640 100644 --- a/recipes/zeitde_sub.recipe +++ b/recipes/zeitde_sub.recipe @@ -224,7 +224,7 @@ class ZeitEPUBAbo(BasicNewsRecipe): # doing regular expression filtering for path in walk('.'): - (shortname, extension) = os.path.splitext(path) + shortname, extension = os.path.splitext(path) if extension.lower() in ('.html', '.htm', '.xhtml'): with open(path, 'r+b') as f: raw = f.read() diff --git a/src/calibre/db/__init__.py b/src/calibre/db/__init__.py index 05481f3625..e5ac6dd5b2 100644 --- a/src/calibre/db/__init__.py +++ b/src/calibre/db/__init__.py @@ -56,16 +56,16 @@ def _get_series_values(val): import re series_index_pat = re.compile(r'(.*)\s+\[([.0-9]+)\]$') if not val: - return (val, None) + return val, None match = series_index_pat.match(val.strip()) if match is not None: idx = match.group(2) try: idx = float(idx) - return (match.group(1).strip(), idx) + return match.group(1).strip(), idx except: pass - return (val, None) + return val, None def get_data_as_dict(self, prefix=None, authors_as_string=False, ids=None, convert_to_local_tz=True): diff --git a/src/calibre/db/backend.py b/src/calibre/db/backend.py index 734845599a..592bbfd6db 100644 --- a/src/calibre/db/backend.py +++ b/src/calibre/db/backend.py @@ -697,7 +697,7 @@ class DB: self.deleted_fields = [] with self.conn: # Delete previously marked custom columns - for (num, label) in self.conn.get( + for num, label in self.conn.get( 'SELECT id,label FROM custom_columns WHERE mark_for_delete=1'): table, lt = self.custom_table_names(num) self.execute('''\ @@ -2455,9 +2455,7 @@ class DB: ts = now.isoformat() timestamp = (now - EPOCH).total_seconds() for annot_id in annot_ids: - for (raw_annot_data, annot_type) in self.execute( - 'SELECT annot_data, annot_type FROM annotations WHERE id=?', (annot_id,) - ): + for raw_annot_data, annot_type in self.execute('SELECT annot_data, annot_type FROM annotations WHERE id=?', (annot_id,)): try: annot_data = json.loads(raw_annot_data) except Exception: diff --git a/src/calibre/db/legacy.py b/src/calibre/db/legacy.py index 5af14916e2..b54e515bb2 100644 --- a/src/calibre/db/legacy.py +++ b/src/calibre/db/legacy.py @@ -721,8 +721,8 @@ class LibraryDatabase: if isinstance(ans, tuple): ans = list(ans) if data['datatype'] != 'series': - return (ans, None) - return (ans, self.new_api.field_for(self.custom_field_name(label, num) + '_index', book_id)) + return ans, None + return ans, self.new_api.field_for(self.custom_field_name(label, num) + '_index', book_id) def get_next_cc_series_num_for(self, series, label=None, num=None): data = self.backend.custom_field_metadata(label, num) diff --git a/src/calibre/db/locking.py b/src/calibre/db/locking.py index 579e890111..7bd797f917 100644 --- a/src/calibre/db/locking.py +++ b/src/calibre/db/locking.py @@ -125,7 +125,7 @@ class SHLock: # {{{ # If there are waiting shared locks, issue them # all and them wake everyone up. if self._shared_queue: - for (thread, waiter) in self._shared_queue: + for thread, waiter in self._shared_queue: self.is_shared += 1 self._shared_owners[thread] = 1 waiter.notify() @@ -133,7 +133,7 @@ class SHLock: # {{{ # Otherwise, if there are waiting exclusive locks, # they get first dibbs on the lock. elif self._exclusive_queue: - (thread, waiter) = self._exclusive_queue.pop(0) + thread, waiter = self._exclusive_queue.pop(0) self._exclusive_owner = thread self.is_exclusive += 1 waiter.notify() @@ -149,7 +149,7 @@ class SHLock: # {{{ # If there are waiting exclusive locks, # they get first dibbs on the lock. if self._exclusive_queue: - (thread, waiter) = self._exclusive_queue.pop(0) + thread, waiter = self._exclusive_queue.pop(0) self._exclusive_owner = thread self.is_exclusive += 1 waiter.notify() diff --git a/src/calibre/db/notes/connect.py b/src/calibre/db/notes/connect.py index e5df66f2ef..97ac783cf7 100644 --- a/src/calibre/db/notes/connect.py +++ b/src/calibre/db/notes/connect.py @@ -280,7 +280,7 @@ class Notes: if field_name: return {item_id for (item_id,) in conn.execute('SELECT item FROM notes_db.notes WHERE colname=?', (field_name,))} ans = defaultdict(set) - for (note_id, field_name) in conn.execute('SELECT item, colname FROM notes_db.notes'): + for note_id, field_name in conn.execute('SELECT item, colname FROM notes_db.notes'): ans[field_name].add(note_id) return ans diff --git a/src/calibre/db/restore.py b/src/calibre/db/restore.py index 8c2cb76054..5179894226 100644 --- a/src/calibre/db/restore.py +++ b/src/calibre/db/restore.py @@ -162,10 +162,10 @@ class Restore(Thread): self.tb = traceback.format_exc() if self.failed_dirs: for x in self.failed_dirs: - for (dirpath, tb) in self.failed_dirs: + for dirpath, tb in self.failed_dirs: self.tb += f'\n\n-------------\nFailed to restore: {dirpath}\n{tb}' if self.failed_restores: - for (book, tb) in self.failed_restores: + for book, tb in self.failed_restores: self.tb += f'\n\n-------------\nFailed to restore: {book["path"]}\n{tb}' def load_preferences(self): diff --git a/src/calibre/db/utils.py b/src/calibre/db/utils.py index 1adf98b927..d35067af72 100644 --- a/src/calibre/db/utils.py +++ b/src/calibre/db/utils.py @@ -201,7 +201,7 @@ class ThumbnailCache: try: uuid, book_id = line.partition(' ')[0::2] book_id = int(book_id) - return (uuid, book_id) + return uuid, book_id except Exception: return None invalidate = {record(x) for x in raw.splitlines()} diff --git a/src/calibre/db/write.py b/src/calibre/db/write.py index 236500cd82..7d9065bc8a 100644 --- a/src/calibre/db/write.py +++ b/src/calibre/db/write.py @@ -40,16 +40,16 @@ series_index_pat = re.compile(r'(.*)\s+\[([.0-9]+)\]$') def get_series_values(val): if not val: - return (val, None) + return val, None match = series_index_pat.match(val.strip()) if match is not None: idx = match.group(2) try: idx = float(idx) - return (match.group(1).strip(), idx) + return match.group(1).strip(), idx except: pass - return (val, None) + return val, None def multiple_text(sep, ui_sep, x): diff --git a/src/calibre/devices/folder_device/driver.py b/src/calibre/devices/folder_device/driver.py index ea5f67e28d..b32e34a617 100644 --- a/src/calibre/devices/folder_device/driver.py +++ b/src/calibre/devices/folder_device/driver.py @@ -92,7 +92,7 @@ class FOLDER_DEVICE(USBMS): self.report_progress = report_progress def card_prefix(self, end_session=True): - return (None, None) + return None, None def eject(self): self.is_connected = False diff --git a/src/calibre/devices/kobo/driver.py b/src/calibre/devices/kobo/driver.py index 91e0f2e2a6..369ea8c31d 100644 --- a/src/calibre/devices/kobo/driver.py +++ b/src/calibre/devices/kobo/driver.py @@ -2823,7 +2823,7 @@ class KOBOTOUCH(KOBO): # Did we actually want to letterbox? if not letterbox: canvas_size = kobo_size - return (kobo_size, canvas_size) + return kobo_size, canvas_size def _create_cover_data( self, cover_data, resize_to, minify_to, kobo_size, diff --git a/src/calibre/devices/prs505/sony_cache.py b/src/calibre/devices/prs505/sony_cache.py index cbfad82082..bced104cf4 100644 --- a/src/calibre/devices/prs505/sony_cache.py +++ b/src/calibre/devices/prs505/sony_cache.py @@ -687,7 +687,7 @@ class XMLCache: if 'id' not in record.attrib: num = self.max_id(record.getroottree().getroot()) record.set('id', str(num+1)) - return (gtz_count, ltz_count, use_tz_var) + return gtz_count, ltz_count, use_tz_var # }}} # Writing the XML files {{{ diff --git a/src/calibre/devices/smart_device_app/driver.py b/src/calibre/devices/smart_device_app/driver.py index c8d0e52747..123fff02cd 100644 --- a/src/calibre/devices/smart_device_app/driver.py +++ b/src/calibre/devices/smart_device_app/driver.py @@ -1261,16 +1261,16 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin): @synchronous('sync_lock') def card_prefix(self, end_session=True): self._debug() - return (None, None) + return None, None @synchronous('sync_lock') def total_space(self, end_session=True): self._debug() opcode, result = self._call_client('TOTAL_SPACE', {}) if opcode == 'OK': - return (result['total_space_on_device'], 0, 0) + return result['total_space_on_device'], 0, 0 # protocol error if we get here - return (0, 0, 0) + return 0, 0, 0 @synchronous('sync_lock') def free_space(self, end_session=True): @@ -1280,7 +1280,7 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin): self._debug('free space:', result['free_space_on_device']) return (result['free_space_on_device'], 0, 0) # protocol error if we get here - return (0, 0, 0) + return 0, 0, 0 @synchronous('sync_lock') def books(self, oncard=None, end_session=True): @@ -1591,7 +1591,7 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin): @synchronous('sync_lock') def prepare_addable_books(self, paths, this_book=None, total_books=None): for idx, path in enumerate(paths): - (ign, ext) = os.path.splitext(path) + ign, ext = os.path.splitext(path) with PersistentTemporaryFile(suffix=ext) as tf: self.get_file(path, tf, this_book=this_book, total_books=total_books) paths[idx] = tf.name @@ -1630,12 +1630,12 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin): def _check_if_format_send_needed(self, db, id_, book): if not self.will_ask_for_update_books: - return (None, False) + return None, False from calibre.utils.date import isoformat, parse_date try: if not hasattr(book, '_format_mtime_'): - return (None, False) + return None, False ext = posixpath.splitext(book.lpath)[1][1:] fmt_metadata = db.new_api.format_metadata(id_, ext) @@ -1647,17 +1647,17 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin): self._show_message(_('You have book formats in your library ' 'with dates in the future. See calibre ' 'for details')) - return (None, True) + return None, True cc_mtime = parse_date(book.get('_format_mtime_'), as_utc=True) self._debug(book.title, 'cal_mtime', calibre_mtime, 'cc_mtime', cc_mtime) if cc_mtime < calibre_mtime: book.set('_format_mtime_', isoformat(self.now)) - return (posixpath.basename(book.lpath), False) + return posixpath.basename(book.lpath), False except: self._debug('exception checking if must send format', book.title) traceback.print_exc() - return (None, False) + return None, False @synchronous('sync_lock') def synchronize_with_db(self, db, id_, book, first_call): diff --git a/src/calibre/devices/usbms/books.py b/src/calibre/devices/usbms/books.py index 8825eb5503..a37cca5c3d 100644 --- a/src/calibre/devices/usbms/books.py +++ b/src/calibre/devices/usbms/books.py @@ -299,7 +299,7 @@ class CollectionsBookList(BookList): if all_by_title not in collections: collections[all_by_title] = {} collections[all_by_title][lpath] = (book, tsval, asval) - for (n, sb) in all_by_something: + for n,sb in all_by_something: if n not in collections: collections[n] = {} collections[n][lpath] = (book, book.get(sb, ''), tsval) diff --git a/src/calibre/devices/usbms/device.py b/src/calibre/devices/usbms/device.py index fc98ab20e1..c9acd4e8fa 100644 --- a/src/calibre/devices/usbms/device.py +++ b/src/calibre/devices/usbms/device.py @@ -174,7 +174,7 @@ class Device(DeviceConfig, DevicePlugin): casz = self._windows_space(self._card_a_prefix)[0] cbsz = self._windows_space(self._card_b_prefix)[0] - return (msz, casz, cbsz) + return msz, casz, cbsz def free_space(self, end_session=True): msz = casz = cbsz = 0 @@ -193,7 +193,7 @@ class Device(DeviceConfig, DevicePlugin): casz = self._windows_space(self._card_a_prefix)[1] cbsz = self._windows_space(self._card_b_prefix)[1] - return (msz, casz, cbsz) + return msz, casz, cbsz def windows_filter_pnp_id(self, pnp_id): return False diff --git a/src/calibre/ebooks/covers.py b/src/calibre/ebooks/covers.py index 6b8bbc9240..8b106f7663 100644 --- a/src/calibre/ebooks/covers.py +++ b/src/calibre/ebooks/covers.py @@ -192,7 +192,7 @@ class Block: @position.setter def position(self, new_pos): - (x, y) = new_pos + x, y = new_pos self._position = Point(x, y) if self.layouts: self.layouts[0].setPosition(QPointF(x, y)) diff --git a/src/calibre/ebooks/docx/styles.py b/src/calibre/ebooks/docx/styles.py index 35a14052af..ed7aea361a 100644 --- a/src/calibre/ebooks/docx/styles.py +++ b/src/calibre/ebooks/docx/styles.py @@ -499,7 +499,7 @@ class Styles: prefix = ef + '\n' + prefix ans = [] - for (cls, css) in sorted(itervalues(self.classes), key=lambda x:x[0]): + for cls, css in sorted(itervalues(self.classes), key=lambda x:x[0]): b = (f'\t{k}: {v};' for k, v in iteritems(css)) b = '\n'.join(b) ans.append('.{} {{\n{}\n}}\n'.format(cls, b.rstrip(';'))) diff --git a/src/calibre/ebooks/htmlz/oeb2html.py b/src/calibre/ebooks/htmlz/oeb2html.py index d3798a8aec..23710d0fb1 100644 --- a/src/calibre/ebooks/htmlz/oeb2html.py +++ b/src/calibre/ebooks/htmlz/oeb2html.py @@ -411,14 +411,14 @@ def oeb2html_no_css(oeb_book, log, opts): izer = OEB2HTMLNoCSSizer(log) html = izer.oeb2html(oeb_book, opts) images = izer.images - return (html, images) + return html, images def oeb2html_inline_css(oeb_book, log, opts): izer = OEB2HTMLInlineCSSizer(log) html = izer.oeb2html(oeb_book, opts) images = izer.images - return (html, images) + return html, images def oeb2html_class_css(oeb_book, log, opts): @@ -426,4 +426,4 @@ def oeb2html_class_css(oeb_book, log, opts): setattr(opts, 'class_style', 'inline') html = izer.oeb2html(oeb_book, opts) images = izer.images - return (html, images) + return html, images diff --git a/src/calibre/ebooks/lit/reader.py b/src/calibre/ebooks/lit/reader.py index c9c513954c..5666d84b53 100644 --- a/src/calibre/ebooks/lit/reader.py +++ b/src/calibre/ebooks/lit/reader.py @@ -864,7 +864,7 @@ class LitFile: def get_atoms(self, entry): name = '/'.join(('/data', entry.internal, 'atom')) if name not in self.entries: - return ({}, {}) + return {}, {} data = self.get_file(name) nentries, data = u32(data), data[4:] tags = {} @@ -878,7 +878,7 @@ class LitFile: if len(tags) != nentries: self._warn('damaged or invalid atoms tag table') if len(data) < 4: - return (tags, {}) + return tags, {} attrs = {} nentries, data = u32(data), data[4:] for i in range(1, nentries + 1): @@ -890,7 +890,7 @@ class LitFile: attrs[i], data = data[:size], data[size:] if len(attrs) != nentries: self._warn('damaged or invalid atoms attributes table') - return (tags, attrs) + return tags, attrs class LitContainer: diff --git a/src/calibre/ebooks/lrf/input.py b/src/calibre/ebooks/lrf/input.py index 4d035b3e82..876e9de36c 100644 --- a/src/calibre/ebooks/lrf/input.py +++ b/src/calibre/ebooks/lrf/input.py @@ -300,7 +300,7 @@ class Styles(etree.XSLTExtension): with open(name, 'wb') as f: f.write(as_bytes(self.CSS)) - for (w, sel) in [(self.text_styles, 'ts'), (self.block_styles, + for w,sel in [(self.text_styles, 'ts'), (self.block_styles, 'bs')]: for i, s in enumerate(w): if not s: diff --git a/src/calibre/ebooks/lrf/objects.py b/src/calibre/ebooks/lrf/objects.py index b21b407a04..286aac9994 100644 --- a/src/calibre/ebooks/lrf/objects.py +++ b/src/calibre/ebooks/lrf/objects.py @@ -1106,7 +1106,7 @@ class Button(LRFObject): for i in self.actions[button_type]: if i[0] == 1: return i[1:][0] - return (None, None) + return None, None def __str__(self): s = '