diff --git a/recipes/daily_mirror.recipe b/recipes/daily_mirror.recipe index e7436f63ec..064aaa5d00 100644 --- a/recipes/daily_mirror.recipe +++ b/recipes/daily_mirror.recipe @@ -57,11 +57,11 @@ class AdvancedUserRecipe1306061239(BasicNewsRecipe): (u'world News', u'http://www.mirror.co.uk/news/world-news/rss.xml'), (u'Sports', u'http://www.mirror.co.uk/sport/rss.xml'), (u'3AM', u'http://www.mirror.co.uk/3am/rss.xml'), - (u'Lifestyle', u'http://www.mirror.co.uk/lifestyle/rss.xml') + (u'Lifestyle', u'http://www.mirror.co.uk/lifestyle/rss.xml'), # example of commented out feed not needed - # ,(u'Travel','http://www.mirror.co.uk/advice/travel/rss.xml') + # (u'Travel','http://www.mirror.co.uk/advice/travel/rss.xml'), ] extra_css = ''' h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;} diff --git a/recipes/donga.recipe b/recipes/donga.recipe index d6ac7e5537..95fb83f990 100644 --- a/recipes/donga.recipe +++ b/recipes/donga.recipe @@ -12,16 +12,16 @@ sections = [ ('의학과학', 'science'), ('문화연예', 'culture'), ('스포츠', 'sports'), - ('사람속으로', 'inmul') + ('사람속으로', 'inmul'), # Following sections are marked as marked optional # as default. Uncomment to enable. - # , (u'건강', 'health') - # , (u'레저', 'leisure') - # , (u'도서', 'book') - # , (u'공연', 'show') - # , (u'여성', 'woman') - # , (u'여행', 'travel') - # , (u'생활정보', 'lifeinfo') + # (u'건강', 'health'), + # (u'레저', 'leisure'), + # (u'도서', 'book'), + # (u'공연', 'show'), + # (u'여성', 'woman'), + # (u'여행', 'travel'), + # (u'생활정보', 'lifeinfo'), ] diff --git a/recipes/iprofesional.recipe b/recipes/iprofesional.recipe index c2bbb98246..60564f4743 100644 --- a/recipes/iprofesional.recipe +++ b/recipes/iprofesional.recipe @@ -40,11 +40,11 @@ class iProfesional(BasicNewsRecipe): } keep_only_tags = [ - dict(name='div', attrs={'class': lambda x: x and 'tituloprincipal' in x.split()}) - ,dict(name='div', attrs={'class': lambda x: x and 'bajadanh' in x.split()}) - ,dict(name='div', attrs={'class': lambda x: x and 'datosautornh' in x.split()}) - ,dict(name='div', attrs={'class': lambda x: x and 'fotonotanh' in x.split()}) - ,dict(name='div', attrs={'class': lambda x: x and 'contenidonotanh' in x.split()}) + dict(name='div', attrs={'class': lambda x: x and 'tituloprincipal' in x.split()}), + dict(name='div', attrs={'class': lambda x: x and 'bajadanh' in x.split()}), + dict(name='div', attrs={'class': lambda x: x and 'datosautornh' in x.split()}), + dict(name='div', attrs={'class': lambda x: x and 'fotonotanh' in x.split()}), + dict(name='div', attrs={'class': lambda x: x and 'contenidonotanh' in x.split()}), ] remove_tags = [ dict(name=['meta', 'link', 'base', 'embed', 'object', 'iframe'])] diff --git a/recipes/straitstimes.recipe b/recipes/straitstimes.recipe index 114ab78404..bf9506f28c 100644 --- a/recipes/straitstimes.recipe +++ b/recipes/straitstimes.recipe @@ -40,15 +40,15 @@ class StraitsTimes(BasicNewsRecipe): feeds = [ (u'World' , u'https://www.straitstimes.com/news/world/rss.xml') - ,(u'Business' , u'https://www.straitstimes.com/news/business/rss.xml') - ,(u'Life' , u'https://www.straitstimes.com/news/life/rss.xml') - ,(u'Tech' , u'https://www.straitstimes.com/news/tech/rss.xml') - ,(u'Opinion' , u'https://www.straitstimes.com/news/opinion/rss.xml') - ,(u'Life' , u'https://www.straitstimes.com/news/life/rss.xml') - ,(u'Singapore' , u'https://www.straitstimes.com/news/singapore/rss.xml') - ,(u'Asia' , u'https://www.straitstimes.com/news/asia/rss.xml') - ,(u'Multimedia' , u'https://www.straitstimes.com/news/multimedia/rss.xml') - ,(u'Sport' , u'https://www.straitstimes.com/news/sport/rss.xml') + (u'Business' , u'https://www.straitstimes.com/news/business/rss.xml'), + (u'Life' , u'https://www.straitstimes.com/news/life/rss.xml'), + (u'Tech' , u'https://www.straitstimes.com/news/tech/rss.xml'), + (u'Opinion' , u'https://www.straitstimes.com/news/opinion/rss.xml'), + (u'Life' , u'https://www.straitstimes.com/news/life/rss.xml'), + (u'Singapore' , u'https://www.straitstimes.com/news/singapore/rss.xml'), + (u'Asia' , u'https://www.straitstimes.com/news/asia/rss.xml'), + (u'Multimedia' , u'https://www.straitstimes.com/news/multimedia/rss.xml'), + (u'Sport' , u'https://www.straitstimes.com/news/sport/rss.xml'), ] def preprocess_html(self, soup): diff --git a/recipes/weblogs_sl.recipe b/recipes/weblogs_sl.recipe index 571ad1c55b..7517fc0a9f 100644 --- a/recipes/weblogs_sl.recipe +++ b/recipes/weblogs_sl.recipe @@ -29,58 +29,58 @@ class weblogssl(BasicNewsRecipe): no_stylesheets = True # Si no se quiere recuperar todos los blogs se puede suprimir la descarga del que se desee poniendo - # un caracter # por delante, es decir, # ,(u'Applesfera', u'http://feeds.weblogssl.com/applesfera') + # un caracter # por delante, es decir, # (u'Applesfera', u'http://feeds.weblogssl.com/applesfera'), # haría que no se descargase Applesfera. feeds = [ - (u'Xataka', u'http://feeds.weblogssl.com/xataka2') - ,(u'Xataka M\xf3vil', u'http://feeds.weblogssl.com/xatakamovil') - ,(u'Xataka Foto', u'http://feeds.weblogssl.com/xatakafoto') - ,(u'Xataka Android', u'http://feeds.weblogssl.com/xatakandroid') - ,(u'Xataka Smart Home', u'http://feeds.weblogssl.com/Xatakahome') - ,(u'Xataka Windows', u'http://feeds.weblogssl.com/xatakawindows') - ,(u'Xataka Ciencia', u'http://feeds.weblogssl.com/xatakaciencia') - ,(u'Applesfera', u'http://feeds.weblogssl.com/applesfera') - ,(u'Vida Extra', u'http://feeds.weblogssl.com/vidaextra') - ,(u'Genbeta', u'http://feeds.weblogssl.com/genbeta') - ,(u'Genbeta Dev', u'http://feeds.weblogssl.com/genbetadev') - ,(u'Magnet', u'http://feeds.weblogssl.com/xatakamagnet2') + (u'Xataka', u'http://feeds.weblogssl.com/xataka2'), + (u'Xataka M\xf3vil', u'http://feeds.weblogssl.com/xatakamovil'), + (u'Xataka Foto', u'http://feeds.weblogssl.com/xatakafoto'), + (u'Xataka Android', u'http://feeds.weblogssl.com/xatakandroid'), + (u'Xataka Smart Home', u'http://feeds.weblogssl.com/Xatakahome'), + (u'Xataka Windows', u'http://feeds.weblogssl.com/xatakawindows'), + (u'Xataka Ciencia', u'http://feeds.weblogssl.com/xatakaciencia'), + (u'Applesfera', u'http://feeds.weblogssl.com/applesfera'), + (u'Vida Extra', u'http://feeds.weblogssl.com/vidaextra'), + (u'Genbeta', u'http://feeds.weblogssl.com/genbeta'), + (u'Genbeta Dev', u'http://feeds.weblogssl.com/genbetadev'), + (u'Magnet', u'http://feeds.weblogssl.com/xatakamagnet2'), - ,(u'Tendencias', u'http://feeds.weblogssl.com/trendencias') - ,(u'Tendencias Belleza', u'http://feeds.weblogssl.com/trendenciasbelleza') - ,(u'Tendencias Hombre', u'http://feeds.weblogssl.com/trendenciashombre') - ,(u'Tendencias Lifestyle', u'http://feeds.weblogssl.com/trendenciaslifestyle') - ,(u'Directo al paladar', u'http://feeds.weblogssl.com/directoalpaladar') - ,(u'Beb\xe9s y m\xe1s', u'http://feeds.weblogssl.com/bebesymas') - ,(u'Vit\xf3nica', u'http://feeds.weblogssl.com/vitonica') - ,(u'Decoesfera', u'http://feeds.weblogssl.com/decoesfera') - ,(u'Embelezzia', u'http://feeds.weblogssl.com/embelezzia') - ,(u'Pop rosa', u'http://feeds.weblogssl.com/poprosa') + (u'Tendencias', u'http://feeds.weblogssl.com/trendencias'), + (u'Tendencias Belleza', u'http://feeds.weblogssl.com/trendenciasbelleza'), + (u'Tendencias Hombre', u'http://feeds.weblogssl.com/trendenciashombre'), + (u'Tendencias Lifestyle', u'http://feeds.weblogssl.com/trendenciaslifestyle'), + (u'Directo al paladar', u'http://feeds.weblogssl.com/directoalpaladar'), + (u'Beb\xe9s y m\xe1s', u'http://feeds.weblogssl.com/bebesymas'), + (u'Vit\xf3nica', u'http://feeds.weblogssl.com/vitonica'), + (u'Decoesfera', u'http://feeds.weblogssl.com/decoesfera'), + (u'Embelezzia', u'http://feeds.weblogssl.com/embelezzia'), + (u'Pop rosa', u'http://feeds.weblogssl.com/poprosa'), - ,(u'Motorpasi\xf3n', u'http://feeds.weblogssl.com/motorpasion') - ,(u'Motorpasi\xf3n Moto', u'http://feeds.weblogssl.com/motorpasionmoto') - ,(u'Motorpasi\xf3n Futuro', u'http://feeds.weblogssl.com/motorpasionfuturo') + (u'Motorpasi\xf3n', u'http://feeds.weblogssl.com/motorpasion'), + (u'Motorpasi\xf3n Moto', u'http://feeds.weblogssl.com/motorpasionmoto'), + (u'Motorpasi\xf3n Futuro', u'http://feeds.weblogssl.com/motorpasionfuturo'), - ,(u'Blog de Cine', u'http://feeds.weblogssl.com/blogdecine') - ,(u'Vaya tele', u'http://feeds.weblogssl.com/vayatele2') - ,(u'Diario del viajero', u'http://feeds.weblogssl.com/diariodelviajero') - ,(u'Papel en blanco', u'http://feeds.weblogssl.com/papelenblanco') + (u'Blog de Cine', u'http://feeds.weblogssl.com/blogdecine'), + (u'Vaya tele', u'http://feeds.weblogssl.com/vayatele2'), + (u'Diario del viajero', u'http://feeds.weblogssl.com/diariodelviajero'), + (u'Papel en blanco', u'http://feeds.weblogssl.com/papelenblanco'), - ,(u'El blog salm\xf3n', u'http://feeds.weblogssl.com/elblogsalmon2') - ,(u'Pymes y aut\xf3nomos', u'http://feeds.weblogssl.com/pymesyautonomos') - ,(u'Ahorro diario', u'http://feeds.weblogssl.com/ahorrodiario') + (u'El blog salm\xf3n', u'http://feeds.weblogssl.com/elblogsalmon2'), + (u'Pymes y aut\xf3nomos', u'http://feeds.weblogssl.com/pymesyautonomos'), + (u'Ahorro diario', u'http://feeds.weblogssl.com/ahorrodiario'), - ,(u'Xataka México', u'http://feeds.weblogssl.com/xatakamx') - ,(u'Xataka Android México', u'http://feeds.weblogssl.com/xatakandroidmx') - ,(u'Vida Extra México', u'http://feeds.weblogssl.com/vidaextramx') - ,(u'Xataka Colombia', u'http://feeds.weblogssl.com/xatakaco') + (u'Xataka México', u'http://feeds.weblogssl.com/xatakamx'), + (u'Xataka Android México', u'http://feeds.weblogssl.com/xatakandroidmx'), + (u'Vida Extra México', u'http://feeds.weblogssl.com/vidaextramx'), + (u'Xataka Colombia', u'http://feeds.weblogssl.com/xatakaco'), - ,(u'Directo al paladar México', u'http://feeds.weblogssl.com/directoalpaladarmx') - ,(u'Vit\xf3nica México', u'http://feeds.weblogssl.com/vitonicamx') - ,(u'Tendencias Hombre México', u'http://feeds.weblogssl.com/trendenciashombremx') + (u'Directo al paladar México', u'http://feeds.weblogssl.com/directoalpaladarmx'), + (u'Vit\xf3nica México', u'http://feeds.weblogssl.com/vitonicamx'), + (u'Tendencias Hombre México', u'http://feeds.weblogssl.com/trendenciashombremx'), - ,(u'Motorpasi\xf3n México', u'http://feeds.weblogssl.com/motorpasionmx') + (u'Motorpasi\xf3n México', u'http://feeds.weblogssl.com/motorpasionmx'), ] keep_only_tags = [ diff --git a/resources/default_tweaks.py b/resources/default_tweaks.py index 546916e809..4cc9273d99 100644 --- a/resources/default_tweaks.py +++ b/resources/default_tweaks.py @@ -234,9 +234,9 @@ per_language_title_sort_articles = { 'Della\\s+', 'Dello\\s+', "Dell'", 'Dell´'), # Portuguese 'por': (r'A\s+', r'O\s+', r'Os\s+', r'As\s+', r'Um\s+', r'Uns\s+', - r'Uma\s+', r'Umas\s+', ), + r'Uma\s+', r'Umas\s+'), # Romanian - 'ron': (r'Un\s+', r'O\s+', r'Nişte\s+', ), + 'ron': (r'Un\s+', r'O\s+', r'Nişte\s+'), # German 'deu': (r'Der\s+', r'Die\s+', r'Das\s+', r'Den\s+', r'Ein\s+', r'Eine\s+', r'Einen\s+', r'Dem\s+', r'Des\s+', r'Einem\s+', @@ -246,16 +246,16 @@ per_language_title_sort_articles = { r'Ener\s+', r'Enes\s+', r'Den\s+', r'Der\s+', r'Des\s+', r"'t\s+"), # Swedish - 'swe': (r'En\s+', r'Ett\s+', r'Det\s+', r'Den\s+', r'De\s+', ), + 'swe': (r'En\s+', r'Ett\s+', r'Det\s+', r'Den\s+', r'De\s+'), # Turkish - 'tur': (r'Bir\s+', ), + 'tur': (r'Bir\s+',), # Afrikaans - 'afr': (r"'n\s+", r'Die\s+', ), + 'afr': (r"'n\s+", r'Die\s+'), # Greek 'ell': (r'O\s+', r'I\s+', r'To\s+', r'Ta\s+', r'Tus\s+', r'Tis\s+', - r"'Enas\s+", r"'Mia\s+", r"'Ena\s+", r"'Enan\s+", ), + r"'Enas\s+", r"'Mia\s+", r"'Ena\s+", r"'Enan\s+"), # Hungarian - 'hun': (r'A\s+', r'Az\s+', r'Egy\s+',), + 'hun': (r'A\s+', r'Az\s+', r'Egy\s+'), } default_language_for_title_sort = None title_sort_articles = r'^(A|The|An)\s+' diff --git a/src/calibre/ebooks/conversion/utils.py b/src/calibre/ebooks/conversion/utils.py index d31e601dc0..2aff246c21 100644 --- a/src/calibre/ebooks/conversion/utils.py +++ b/src/calibre/ebooks/conversion/utils.py @@ -260,8 +260,8 @@ class HeuristicProcessor: [r"[^'\"]?(\d+)\s*([\dA-Z\-\'\"\?!#,]+\s*){0,7}\s*", True, True, True, False, 'Searching for simple numeric headings', 'plain_number'], # Numeric Chapters, no dot or colon [r"\s*[^'\"]?([A-Z#]+(\s|-){0,3}){1,5}\s*", False, True, False, False, - 'Searching for chapters with Uppercase Characters', 'uppercase'] # Uppercase Chapters - ] + 'Searching for chapters with Uppercase Characters', 'uppercase'], # Uppercase Chapters + ] def recurse_patterns(html, analyze): # Start with most typical chapter headings, get more aggressive until one works diff --git a/src/calibre/ebooks/metadata/sources/edelweiss.py b/src/calibre/ebooks/metadata/sources/edelweiss.py index 94719d0765..35d5d370a6 100644 --- a/src/calibre/ebooks/metadata/sources/edelweiss.py +++ b/src/calibre/ebooks/metadata/sources/edelweiss.py @@ -386,24 +386,24 @@ if __name__ == '__main__': ( # A title and author search {'title': "The Husband's Secret", 'authors':['Liane Moriarty']}, [title_test("The Husband's Secret", exact=True), - authors_test(['Liane Moriarty'])] + authors_test(['Liane Moriarty'])] ), ( # An isbn present in edelweiss {'identifiers':{'isbn': '9780312621360'}, }, [title_test('Flame: A Sky Chasers Novel', exact=True), - authors_test(['Amy Kathleen Ryan'])] + authors_test(['Amy Kathleen Ryan'])] ), # Multiple authors and two part title and no general description ({'identifiers':{'edelweiss':'0321180607'}}, - [title_test( - 'XQuery From the Experts: A Guide to the W3C XML Query Language' - , exact=True), authors_test([ + [title_test('XQuery From the Experts: A Guide to the W3C XML Query Language', exact=True), + authors_test([ 'Howard Katz', 'Don Chamberlin', 'Denise Draper', 'Mary Fernandez', 'Michael Kay', 'Jonathan Robie', 'Michael Rys', 'Jerome Simeon', - 'Jim Tivy', 'Philip Wadler']), pubdate_test(2003, 8, 22), - comments_test('Jérôme Siméon'), lambda mi: bool(mi.comments and 'No title summary' not in mi.comments) + 'Jim Tivy', 'Philip Wadler']), + pubdate_test(2003, 8, 22), + comments_test('Jérôme Siméon'), lambda mi: bool(mi.comments and 'No title summary' not in mi.comments) ]), ] start, stop = 0, len(tests) diff --git a/src/calibre/gui2/actions/add.py b/src/calibre/gui2/actions/add.py index 28a0c17047..c2bdc9952c 100644 --- a/src/calibre/gui2/actions/add.py +++ b/src/calibre/gui2/actions/add.py @@ -48,8 +48,8 @@ class AddAction(InterfaceAction): name = 'Add Books' action_spec = (_('Add books'), 'add_book.png', - _('Add books to the calibre library/device from files on your computer') - , _('A')) + _('Add books to the calibre library/device from files on your computer'), + _('A')) action_type = 'current' action_add_menu = True action_menu_clone_qaction = _('Add books from a single folder') diff --git a/src/odf/elementtypes.py b/src/odf/elementtypes.py index 5eaee93cb1..4cd028f753 100644 --- a/src/odf/elementtypes.py +++ b/src/odf/elementtypes.py @@ -337,5 +337,5 @@ empty_elements = ( (TEXTNS,'user-index-mark'), (TEXTNS,'user-index-mark-end'), (TEXTNS,'user-index-mark-start'), - (TEXTNS,'variable-decl') + (TEXTNS,'variable-decl'), ) diff --git a/src/odf/odf2xhtml.py b/src/odf/odf2xhtml.py index e6d563fec7..6c3afa678a 100644 --- a/src/odf/odf2xhtml.py +++ b/src/odf/odf2xhtml.py @@ -1475,7 +1475,7 @@ dl.notes dd:last-of-type { page-break-after: avoid } self.opentag('a', { 'href': f'#footnote-{self.currentnote}', 'class': 'citation', - 'id':f'citation-{self.currentnote}' + 'id':f'citation-{self.currentnote}', }) # self.writeout( escape(mark) ) # Since HTML only knows about endnotes, there is too much risk that the diff --git a/src/qt/__main__.py b/src/qt/__main__.py index 8951c2e582..110f737b7e 100644 --- a/src/qt/__main__.py +++ b/src/qt/__main__.py @@ -29,7 +29,7 @@ module_lists = { ), 'dbus': ( 'QtDBus', - ) + ), } diff --git a/src/qt/loader.py b/src/qt/loader.py index 9ea3d178eb..803be33377 100644 --- a/src/qt/loader.py +++ b/src/qt/loader.py @@ -22,7 +22,7 @@ def dynamic_load(name, name_map, already_imported, qt_modules, module_names=()): mod_name, 'with error:', err, - file=sys.stderr + file=sys.stderr, ) if mod is not False: if name in module_names: