diff --git a/src/calibre/ebooks/conversion/plugins/txt_input.py b/src/calibre/ebooks/conversion/plugins/txt_input.py index 8a37a9b85f..d5d6814830 100644 --- a/src/calibre/ebooks/conversion/plugins/txt_input.py +++ b/src/calibre/ebooks/conversion/plugins/txt_input.py @@ -56,7 +56,7 @@ class TXTInput(InputFormatPlugin): 'as chapter headings and italic text.\n' '* textile: Processing using textile formatting.\n' '* markdown: Processing using markdown formatting. ' - 'To learn more about markdown see')+' http://daringfireball.net/projects/markdown/'), + 'To learn more about markdown see')+' https://daringfireball.net/projects/markdown/'), OptionRecommendation(name='preserve_spaces', recommended_value=False, help=_('Normally extra spaces are condensed into a single space. ' 'With this option all spaces will be displayed.')), @@ -66,7 +66,7 @@ class TXTInput(InputFormatPlugin): OptionRecommendation(name="markdown_extensions", recommended_value='footnotes, tables, toc', help=_('Enable extensions to markdown syntax. Extensions are formatting that is not part ' 'of the standard markdown format. The extensions enabled by default: %default.\n' - 'To learn more about markdown extensions, see http://pythonhosted.org/Markdown/extensions/index.html\n' + 'To learn more about markdown extensions, see https://pythonhosted.org/Markdown/extensions/index.html\n' 'This should be a comma separated list of extensions to enable:\n') + '\n'.join('* %s: %s' % (k, MD_EXTENSIONS[k]) for k in sorted(MD_EXTENSIONS))), ]) @@ -202,7 +202,7 @@ class TXTInput(InputFormatPlugin): input_mi, html = convert_markdown_with_metadata(txt, extensions=[x.strip() for x in options.markdown_extensions.split(',') if x.strip()]) except RuntimeError: raise ValueError('This txt file has malformed markup, it cannot be' - ' converted by calibre. See http://daringfireball.net/projects/markdown/syntax') + ' converted by calibre. See https://daringfireball.net/projects/markdown/syntax') elif options.formatting_type == 'textile': log.debug('Running text through textile conversion...') html = convert_textile(txt) diff --git a/src/calibre/ebooks/conversion/plumber.py b/src/calibre/ebooks/conversion/plumber.py index 88d3d6dbff..3dfa5f0718 100644 --- a/src/calibre/ebooks/conversion/plumber.py +++ b/src/calibre/ebooks/conversion/plumber.py @@ -63,6 +63,7 @@ class CompositeProgressReporter(object): (self.global_max - self.global_min) self.global_reporter(global_frac, msg) + ARCHIVE_FMTS = ('zip', 'rar', 'oebzip') @@ -500,7 +501,7 @@ OptionRecommendation(name='smarten_punctuation', recommended_value=False, level=OptionRecommendation.LOW, help=_('Convert plain quotes, dashes and ellipsis to their ' 'typographically correct equivalents. For details, see ' - 'http://daringfireball.net/projects/smartypants' + 'https://daringfireball.net/projects/smartypants' ) ), @@ -1231,6 +1232,7 @@ OptionRecommendation(name='search_replace', self.log(self.output_fmt.upper(), 'output written to', self.output) self.flush() + # This has to be global as create_oebbook can be called from other locations # (for example in the html input plugin) regex_wizard_callback = None diff --git a/src/calibre/gui2/actions/store.py b/src/calibre/gui2/actions/store.py index 2a55ca65ff..83a80d3078 100644 --- a/src/calibre/gui2/actions/store.py +++ b/src/calibre/gui2/actions/store.py @@ -146,9 +146,8 @@ class StoreAction(InterfaceAction): 'buying from. Be sure to double check that any books you get ' 'will work with your e-book reader, especially if the book you ' 'are buying has ' - 'DRM.' + 'DRM.' )), 'about_get_books_msg', parent=self.gui, show_cancel_button=False, confirm_msg=_('Show this message again'), pixmap='dialog_information.png', title=_('About Get Books')) - diff --git a/src/calibre/gui2/convert/txt_input.ui b/src/calibre/gui2/convert/txt_input.ui index 7b56766f8a..8d0fb4d7a8 100644 --- a/src/calibre/gui2/convert/txt_input.ui +++ b/src/calibre/gui2/convert/txt_input.ui @@ -101,7 +101,7 @@ - <p>Markdown is a simple markup language for text files, that allows for advanced formatting. To learn more visit <a href="http://daringfireball.net/projects/markdown">markdown</a>. + <p>Markdown is a simple markup language for text files, that allows for advanced formatting. To learn more visit <a href="https://daringfireball.net/projects/markdown">markdown</a>. true @@ -124,7 +124,7 @@ - More information on <a href="http://pythonhosted.org/Markdown/extensions/index.html">markdown extensions</a> + More information on <a href="https://pythonhosted.org/Markdown/extensions/index.html">markdown extensions</a> true diff --git a/src/calibre/gui2/dialogs/drm_error.ui b/src/calibre/gui2/dialogs/drm_error.ui index c4b9a1cfdb..3e594315c6 100644 --- a/src/calibre/gui2/dialogs/drm_error.ui +++ b/src/calibre/gui2/dialogs/drm_error.ui @@ -44,8 +44,8 @@ <p>This book is locked by <b>DRM</b>. To learn more about DRM and why you cannot read or convert this book in calibre, - <a href="http://drmfree.calibre-ebook.com/about#drm">click here</a>.<p>A large number of recent, DRM free releases are - available at <a href="http://drmfree.calibre-ebook.com">Open Books</a>. + <a href="https://drmfree.calibre-ebook.com/about#drm">click here</a>.<p>A large number of recent, DRM free releases are + available at <a href="https://drmfree.calibre-ebook.com">Open Books</a>. true diff --git a/src/calibre/gui2/dialogs/metadata_bulk.py b/src/calibre/gui2/dialogs/metadata_bulk.py index ee9a6646aa..6579ee66fc 100644 --- a/src/calibre/gui2/dialogs/metadata_bulk.py +++ b/src/calibre/gui2/dialogs/metadata_bulk.py @@ -55,6 +55,7 @@ def get_cover_data(stream, ext): # {{{ return cdata, area # }}} + Settings = namedtuple('Settings', 'remove_all remove add au aus do_aus rating pub do_series do_autonumber do_remove_format ' 'remove_format do_swap_ta do_remove_conv do_auto_author series do_series_restart series_start_value series_increment ' @@ -529,7 +530,7 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog): 'The destination box specifies the field where the result after ' 'matching and replacement is to be assigned. You can replace ' 'the text in the field, or prepend or append the matched text. ' - 'See ' + 'See ' 'this reference for more information on python\'s regular ' 'expressions, and in particular the \'sub\' function.' ) @@ -1228,5 +1229,3 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog): self.results_count.setValue(999) self.starting_from.setValue(1) self.multiple_separator.setText(" ::: ") - - diff --git a/src/calibre/gui2/preferences/texture_chooser.py b/src/calibre/gui2/preferences/texture_chooser.py index 8f8f777634..0b8624888f 100644 --- a/src/calibre/gui2/preferences/texture_chooser.py +++ b/src/calibre/gui2/preferences/texture_chooser.py @@ -53,7 +53,7 @@ class TextureChooser(QDialog): il.itemSelectionChanged.connect(self.update_remove_state) l.addWidget(il) - self.ad = ad = QLabel(_('The builtin textures come from subtlepatterns.com.')) + self.ad = ad = QLabel(_('The builtin textures come from subtlepatterns.com.')) ad.setOpenExternalLinks(True) ad.setWordWrap(True) l.addWidget(ad) @@ -147,6 +147,7 @@ class TextureChooser(QDialog): os.remove(unicode(self.selected_item.data(Qt.UserRole+1) or '')) self.images.takeItem(self.images.row(self.selected_item)) + if __name__ == '__main__': app = QApplication([]) # noqa d = TextureChooser() diff --git a/src/calibre/gui2/store/stores/open_books_plugin.py b/src/calibre/gui2/store/stores/open_books_plugin.py index a5683d07ca..e91fb423ad 100644 --- a/src/calibre/gui2/store/stores/open_books_plugin.py +++ b/src/calibre/gui2/store/stores/open_books_plugin.py @@ -25,7 +25,7 @@ from calibre.gui2.store.web_store_dialog import WebStoreDialog class OpenBooksStore(BasicStoreConfig, StorePlugin): def open(self, parent=None, detail_item=None, external=False): - url = 'http://drmfree.calibre-ebook.com/' + url = 'https://drmfree.calibre-ebook.com/' if external or self.config.get('open_external', False): open_url(QUrl(url_slash_cleaner(detail_item if detail_item else url))) @@ -36,7 +36,7 @@ class OpenBooksStore(BasicStoreConfig, StorePlugin): d.exec_() def search(self, query, max_results=10, timeout=60): - url = 'http://drmfree.calibre-ebook.com/search/?q=' + urllib.quote_plus(query) + url = 'https://drmfree.calibre-ebook.com/search/?q=' + urllib.quote_plus(query) br = browser() diff --git a/src/calibre/gui2/store/web_control.py b/src/calibre/gui2/store/web_control.py index e7ee1d2d6f..210c353f48 100644 --- a/src/calibre/gui2/store/web_control.py +++ b/src/calibre/gui2/store/web_control.py @@ -82,7 +82,7 @@ class NPWebView(QWebView): if not confirm('

' + _('This ebook is a DRMed EPUB file. ' 'You will be prompted to save this file to your ' 'computer. Once it is saved, open it with ' - '' + '' 'Adobe Digital Editions (ADE).

ADE, in turn ' 'will download the actual ebook, which will be a ' '.epub file. You can add this book to calibre ' diff --git a/src/calibre/utils/config.py b/src/calibre/utils/config.py index aedcc6e8ec..4463ec5f31 100644 --- a/src/calibre/utils/config.py +++ b/src/calibre/utils/config.py @@ -258,6 +258,7 @@ class DynamicConfig(dict): f.truncate() f.write(raw) + dynamic = DynamicConfig() @@ -267,7 +268,7 @@ class XMLConfig(dict): Similar to :class:`DynamicConfig`, except that it uses an XML storage backend instead of a pickle file. - See `http://docs.python.org/dev/library/plistlib.html`_ for the supported + See `https://docs.python.org/dev/library/plistlib.html`_ for the supported data types. ''' @@ -428,6 +429,5 @@ class DevicePrefs: def __getitem__(self, key): return self.overrides.get(key, self.global_prefs[key]) + device_prefs = DevicePrefs(prefs) - - diff --git a/src/calibre/utils/smartypants.py b/src/calibre/utils/smartypants.py index 9ef0548c50..3ea96765d1 100644 --- a/src/calibre/utils/smartypants.py +++ b/src/calibre/utils/smartypants.py @@ -305,7 +305,7 @@ Copyright and License SmartyPants_ license:: Copyright (c) 2003 John Gruber - (http://daringfireball.net/) + (https://daringfireball.net/) All rights reserved. Redistribution and use in source and binary forms, with or without @@ -367,11 +367,11 @@ smartypants.py license:: -.. _John Gruber: http://daringfireball.net/ +.. _John Gruber: https://daringfireball.net/ .. _Chad Miller: http://web.chad.org/ .. _Pyblosxom: http://roughingit.subtlehints.net/pyblosxom -.. _SmartyPants: http://daringfireball.net/projects/smartypants/ +.. _SmartyPants: https://daringfireball.net/projects/smartypants/ .. _Movable Type: http://www.movabletype.org/ """ diff --git a/src/calibre/utils/titlecase.py b/src/calibre/utils/titlecase.py index b1d1959716..196e174e4b 100755 --- a/src/calibre/utils/titlecase.py +++ b/src/calibre/utils/titlecase.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- """ -Original Perl version by: John Gruber http://daringfireball.net/ 10 May 2008 +Original Perl version by: John Gruber https://daringfireball.net/ 10 May 2008 Python version by Stuart Colville http://muffinresearch.co.uk Modifications to make it work with non-ascii chars by Kovid Goyal License: http://www.opensource.org/licenses/mit-license.php @@ -100,4 +100,3 @@ def titlecase(text): ), result) return result -