From 0448865f31b7a4533360582d185b66e6e49e87a5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 9 Jan 2017 08:44:14 +0530 Subject: [PATCH] Change links pointing to mobileread to use https --- format_docs/pdb/mobi.txt | 2 +- manual/catalogs.rst | 8 ++++---- manual/creating_plugins.rst | 4 ++-- manual/customize.rst | 2 +- manual/develop.rst | 8 ++++---- manual/faq.rst | 2 +- manual/news.rst | 4 ++-- manual/regexp.rst | 2 +- manual/viewer.rst | 2 +- src/calibre/db/cache.py | 3 ++- src/calibre/devices/apple/driver.py | 7 ++++--- src/calibre/devices/misc.py | 8 +++----- src/calibre/devices/usbms/device.py | 2 +- src/calibre/ebooks/metadata/fb2.py | 2 +- src/calibre/ebooks/metadata/html.py | 3 ++- src/calibre/ebooks/metadata/kfx.py | 4 +++- src/calibre/ebooks/mobi/reader/mobi8.py | 2 +- src/calibre/gui2/main.py | 5 ++--- .../gui2/store/stores/mobileread/cache_update_thread.py | 2 +- .../gui2/store/stores/mobileread/mobileread_plugin.py | 2 +- src/calibre/gui2/viewer/config.ui | 2 +- src/calibre/library/server/base.py | 3 ++- src/calibre/utils/img.py | 5 +---- src/calibre/utils/winreg/default_programs.py | 4 +++- 24 files changed, 45 insertions(+), 43 deletions(-) diff --git a/format_docs/pdb/mobi.txt b/format_docs/pdb/mobi.txt index bf08bd8b71..5763866d65 100644 --- a/format_docs/pdb/mobi.txt +++ b/format_docs/pdb/mobi.txt @@ -1,4 +1,4 @@ -from (http://wiki.mobileread.com/wiki/MOBI) +from (https://wiki.mobileread.com/wiki/MOBI) About ----- diff --git a/manual/catalogs.rst b/manual/catalogs.rst index da6e28b09b..73d207579c 100644 --- a/manual/catalogs.rst +++ b/manual/catalogs.rst @@ -112,7 +112,7 @@ Other options :guilabel:`Catalog cover` specifies whether to generate a new cover or use an existing cover. It is possible to create a custom cover for your catalogs - see :ref:`Custom catalog covers` for more information. If you have created a custom cover that you want to reuse, select :guilabel:`Use existing cover`. Otherwise, select :guilabel:`Generate new cover`. -:guilabel:`Extra Description note` specifies a custom column's contents to be inserted into the Description page, next to the cover thumbnail. For example, you might want to display the date you last read a book using a :guilabel:`Last Read` custom column. For advanced use of the Description note feature, see `this post in the calibre forum `_. +:guilabel:`Extra Description note` specifies a custom column's contents to be inserted into the Description page, next to the cover thumbnail. For example, you might want to display the date you last read a book using a :guilabel:`Last Read` custom column. For advanced use of the Description note feature, see `this post in the calibre forum `_. :guilabel:`Thumb width` specifies a width preference for cover thumbnails included with Descriptions pages. Thumbnails are cached to improve performance.To experiment with different widths, try generating a catalog with just a few books until you've determined your preferred width, then generate your full catalog. The first time a catalog is generated with a new thumbnail width, performance will be slower, but subsequent builds of the catalog will take advantage of the thumbnail cache. @@ -125,13 +125,13 @@ Custom catalog covers .. |cc| image:: images/custom_cover.png -|cc| With the `Generate Cover plugin `_ installed, you can create custom covers for your catalog. +|cc| With the `Generate Cover plugin `_ installed, you can create custom covers for your catalog. To install the plugin, go to :guilabel:`Preferences > Advanced > Plugins > Get new plugins`. Additional help resources --------------------------- -For more information on calibre's Catalog feature, see the MobileRead forum sticky `Creating Catalogs - Start here `_, where you can find information on how to customize the catalog templates, and how to submit a bug report. +For more information on calibre's Catalog feature, see the MobileRead forum sticky `Creating Catalogs - Start here `_, where you can find information on how to customize the catalog templates, and how to submit a bug report. -To ask questions or discuss calibre's Catalog feature with other users, visit the MobileRead forum `Calibre Catalogs `_. +To ask questions or discuss calibre's Catalog feature with other users, visit the MobileRead forum `Calibre Catalogs `_. diff --git a/manual/creating_plugins.rst b/manual/creating_plugins.rst index dea34f03a3..53909192b0 100644 --- a/manual/creating_plugins.rst +++ b/manual/creating_plugins.rst @@ -318,11 +318,11 @@ This will shutdown a running calibre, wait for the shutdown to complete, then up More plugin examples ---------------------- -You can find a list of many, sophisticated calibre plugins `here `_. +You can find a list of many, sophisticated calibre plugins `here `_. Sharing your plugins with others ---------------------------------- If you would like to share the plugins you have created with other users of calibre, post your plugin in a new thread in the -`calibre plugins forum `_. +`calibre plugins forum `_. diff --git a/manual/customize.rst b/manual/customize.rst index e1f5cfe033..2c52d485c1 100644 --- a/manual/customize.rst +++ b/manual/customize.rst @@ -96,7 +96,7 @@ where you have put your icons (usually the :file:`resources/images` folder in the calibre config directory, as described above). Then fill up the theme metadata and click OK. This will result in a zip file containing the theme icons. You can upload that to the calibre forum at `Mobileread -`_ and then I will +`_ and then I will make your theme available via calibre's builtin icon theme system. diff --git a/manual/develop.rst b/manual/develop.rst index b587237a3c..b03cc0d749 100644 --- a/manual/develop.rst +++ b/manual/develop.rst @@ -26,7 +26,7 @@ For example, adding support for a new device to calibre typically involves writi a device driver plugin. You can browse the `built-in drivers `_. Similarly, adding support for new conversion formats involves writing input/output format plugins. Another example of the modular design is the :ref:`recipe system ` for -fetching news. For more examples of plugins designed to add features to calibre, see the `plugin index `_. +fetching news. For more examples of plugins designed to add features to calibre, see the `plugin index `_. .. _code_layout: @@ -68,7 +68,7 @@ If you want to locate the entry points for all the various calibre executables, look at the ``entry_points`` structure in `linux.py `_. -If you need help understanding the code, post in the `development forum `_ +If you need help understanding the code, post in the `development forum `_ and you will most likely get help from one of calibre's many developers. Getting the code @@ -146,7 +146,7 @@ for inclusion into the main calibre repository: You should also keep an eye on the calibre `development forum -`_. Before making +`_. Before making major changes, you should discuss them in the forum or contact Kovid directly (his email address is all over the source code). @@ -182,7 +182,7 @@ in your favorite editor and add the line:: near the top of the file. Now run the command :command:`calibredb`. The very first line of output should be ``Hello, world!``. You can also setup a calibre development environment inside the free Microsoft -Visual Studio, if you like, following the instructions `here `_. +Visual Studio, if you like, following the instructions `here `_. OS X development environment ------------------------------ diff --git a/manual/faq.rst b/manual/faq.rst index ddca228a9e..4cc00982d9 100644 --- a/manual/faq.rst +++ b/manual/faq.rst @@ -207,7 +207,7 @@ Follow these steps to find the problem: etc. at the same time. * If you are connecting an Apple iDevice (iPad, iPod Touch, iPhone), use the 'Connect to iTunes' method in the 'Getting started' instructions in - `Calibre + Apple iDevices: Start here `_. + `Calibre + Apple iDevices: Start here `_. * Make sure you are running the latest version of calibre. The latest version can always be downloaded from `the calibre website `_. You can tell what version of calibre you are currently running by looking diff --git a/manual/news.rst b/manual/news.rst index ec9b7011fa..10cddf8b02 100644 --- a/manual/news.rst +++ b/manual/news.rst @@ -306,7 +306,7 @@ Once the download is complete, you can look at the downloaded :term:`HTML` by op ... -If you're satisfied with your recipe, and you feel there is enough demand to justify its inclusion into the set of built-in recipes, post your recipe in the `calibre recipes forum `_ to share it with other calibre users. +If you're satisfied with your recipe, and you feel there is enough demand to justify its inclusion into the set of built-in recipes, post your recipe in the `calibre recipes forum `_ to share it with other calibre users. .. note:: On OS X, the command line tools are inside the calibre bundle, for example, @@ -333,7 +333,7 @@ To learn more about writing advanced recipes using some of the facilities, avail `Built-in recipes `_ The source code for the built-in recipes that come with calibre - `The calibre recipes forum `_ + `The calibre recipes forum `_ Lots of knowledgeable calibre recipe writers hang out here. diff --git a/manual/regexp.rst b/manual/regexp.rst index 5d38dae9ed..2b3ff46e2e 100644 --- a/manual/regexp.rst +++ b/manual/regexp.rst @@ -105,7 +105,7 @@ Let's begin with the conversion settings, which is really neat. In the Search an

It had only been two years since Addison v. Clark. The court case gave us a revised version of what life was -(shamelessly ripped out of `this thread `_). You'd have to remove some of the tags as well. In this example, I'd recommend beginning with the tag ````, now you have to end with the corresponding closing tag (opening tags are ````, closing tags are ````), which is simply the next ```` in this case. (Refer to a good HTML manual or ask in the forum if you are unclear on this point.) The opening tag can be described using ````, the closing tag using ````, thus we could remove everything between those tags using ``.*?``. But using this expression would be a bad idea, because it removes everything enclosed by - tags (which, by the way, render the enclosed text in bold print), and it's a fair bet that we'll remove portions of the book in this way. Instead, include the beginning of the enclosed string as well, making the regular expression ``\s*Generated\s+by\s+ABC\s+Amber\s+LIT.*?`` The ``\s`` with quantifiers are included here instead of explicitly using the spaces as seen in the string to catch any variations of the string that might occur. Remember to check what calibre will remove to make sure you don't remove any portions you want to keep if you test a new expression. If you only check one occurrence, you might miss a mismatch somewhere else in the text. Also note that should you accidentally remove more or fewer tags than you actually wanted to, calibre tries to repair the damaged code after doing the removal. +(shamelessly ripped out of `this thread `_). You'd have to remove some of the tags as well. In this example, I'd recommend beginning with the tag ````, now you have to end with the corresponding closing tag (opening tags are ````, closing tags are ````), which is simply the next ```` in this case. (Refer to a good HTML manual or ask in the forum if you are unclear on this point.) The opening tag can be described using ````, the closing tag using ````, thus we could remove everything between those tags using ``.*?``. But using this expression would be a bad idea, because it removes everything enclosed by - tags (which, by the way, render the enclosed text in bold print), and it's a fair bet that we'll remove portions of the book in this way. Instead, include the beginning of the enclosed string as well, making the regular expression ``\s*Generated\s+by\s+ABC\s+Amber\s+LIT.*?`` The ``\s`` with quantifiers are included here instead of explicitly using the spaces as seen in the string to catch any variations of the string that might occur. Remember to check what calibre will remove to make sure you don't remove any portions you want to keep if you test a new expression. If you only check one occurrence, you might miss a mismatch somewhere else in the text. Also note that should you accidentally remove more or fewer tags than you actually wanted to, calibre tries to repair the damaged code after doing the removal. Adding books ^^^^^^^^^^^^^^^^ diff --git a/manual/viewer.rst b/manual/viewer.rst index 5346a1f92b..15b35c6113 100644 --- a/manual/viewer.rst +++ b/manual/viewer.rst @@ -88,7 +88,7 @@ by the viewer to ones you like as well as the default font size when the viewer More advanced customization can be achieved by the User Stylesheet setting. This is a stylesheet you can set that will be applied to every book. Using it you can do things like have white text on a black background, change paragraph styles, text justification, etc. -For examples of custom stylesheets used by calibre's users, see `the forums `_. +For examples of custom stylesheets used by calibre's users, see `the forums `_. Dictionary lookup ------------------- diff --git a/src/calibre/db/cache.py b/src/calibre/db/cache.py index 1427fdfda2..00bccf164a 100644 --- a/src/calibre/db/cache.py +++ b/src/calibre/db/cache.py @@ -90,6 +90,7 @@ def _add_newbook_tag(mi): elif tag not in mi.tags: mi.tags.append(tag) + dynamic_category_preferences = frozenset({'grouped_search_make_user_categories', 'grouped_search_terms', 'user_categories'}) @@ -1337,7 +1338,7 @@ class Cache(object): path = self._field_for('path', book_id) if path is None: # Theoretically, this should never happen, but apparently it - # does: http://www.mobileread.com/forums/showthread.php?t=233353 + # does: https://www.mobileread.com/forums/showthread.php?t=233353 self._update_path({book_id}, mark_as_dirtied=False) path = self._field_for('path', book_id) diff --git a/src/calibre/devices/apple/driver.py b/src/calibre/devices/apple/driver.py index 3d6823cb69..7353ea4f43 100644 --- a/src/calibre/devices/apple/driver.py +++ b/src/calibre/devices/apple/driver.py @@ -30,6 +30,7 @@ def strftime(fmt='%Y/%m/%d %H:%M:%S', dt=None): except: return _strftime(fmt, now().timetuple()) + _log = None @@ -67,7 +68,7 @@ class AppleOpenFeedback(OpenFeedback): '

To transfer books to your iDevice, ' 'click Disable Apple Driver, ' "then use the 'Connect to iTunes' method recommended in the " - 'Calibre + iDevices FAQ, ' + 'Calibre + iDevices FAQ, ' 'using the Connect/Share|Connect to iTunes menu item.

' '

Enabling the Apple driver for direct connection to iDevices ' 'is an unsupported advanced user mode.

' @@ -222,12 +223,12 @@ class ITUNES(DriverBase): "Drag from iTunes Library to desktop, then add to calibre's Library window.") UNSUPPORTED_DIRECT_CONNECT_MODE_MESSAGE = _( "*** Unsupported direct connect mode. " - "See http://www.mobileread.com/forums/showthread.php?t=118559 " + "See https://www.mobileread.com/forums/showthread.php?t=118559 " "for instructions on using 'Connect to iTunes' ***") ITUNES_SANDBOX_LOCKOUT_MESSAGE = _( '

Unable to communicate with iTunes.

' '

Refer to this ' - 'forum post ' + 'forum post ' 'for more information.

' '

') diff --git a/src/calibre/devices/misc.py b/src/calibre/devices/misc.py index c36677ddd1..2a2d070ee6 100644 --- a/src/calibre/devices/misc.py +++ b/src/calibre/devices/misc.py @@ -238,9 +238,9 @@ class TREKSTOR(USBMS): 0x0067, # This is for the Pyrus Mini 0x006f, # This is for the Pyrus Maxi 0x003e, # This is for the EBOOK_PLAYER_5M https://bugs.launchpad.net/bugs/792091 - 0x05cL, # This is for the 4ink http://www.mobileread.com/forums/showthread.php?t=191318 - 0x006c, # This is for the 4ink http://www.mobileread.com/forums/showthread.php?t=218273 - 0x006d, # Another Pyrus? http://www.mobileread.com/forums/showthread.php?t=231982 + 0x05cL, # This is for the 4ink https://www.mobileread.com/forums/showthread.php?t=191318 + 0x006c, # This is for the 4ink https://www.mobileread.com/forums/showthread.php?t=218273 + 0x006d, # Another Pyrus? https://www.mobileread.com/forums/showthread.php?t=231982 0x73, # This is for the Pyrus 2 LED https://bugs.launchpad.net/bugs/1376018 ] BCD = [0x0002, 0x100, 0x0222, 0x2] @@ -579,5 +579,3 @@ class CERVANTES(USBMS): EBOOK_DIR_MAIN = 'Books' SCAN_FROM_ROOT = True SUPPORTS_SUB_DIRS = True - - diff --git a/src/calibre/devices/usbms/device.py b/src/calibre/devices/usbms/device.py index a431cecac1..41f49cda17 100644 --- a/src/calibre/devices/usbms/device.py +++ b/src/calibre/devices/usbms/device.py @@ -64,7 +64,7 @@ class USBDevice: return True # As of OS X 10.11.4 Apple started mangling the names returned via the # IOKit registry. See - # http://www.mobileread.com/forums/showthread.php?t=273213 + # https://www.mobileread.com/forums/showthread.php?t=273213 m = osx_sanitize_name_pat.sub('_', (self.manufacturer or '')) p = osx_sanitize_name_pat.sub('_', (self.product or '')) return m == man and p == prod diff --git a/src/calibre/ebooks/metadata/fb2.py b/src/calibre/ebooks/metadata/fb2.py index b77c5e9a24..abfa72741b 100644 --- a/src/calibre/ebooks/metadata/fb2.py +++ b/src/calibre/ebooks/metadata/fb2.py @@ -407,7 +407,7 @@ def set_metadata(stream, mi, apply_null=False, update_timestamp=False): stream.truncate() # Apparently there exists FB2 reading software that chokes on the use of # single quotes in xml declaration. Sigh. See - # http://www.mobileread.com/forums/showthread.php?p=2273184#post2273184 + # https://www.mobileread.com/forums/showthread.php?p=2273184#post2273184 stream.write(b'\n') stream.write(etree.tostring(root, method='xml', encoding='utf-8', xml_declaration=False)) diff --git a/src/calibre/ebooks/metadata/html.py b/src/calibre/ebooks/metadata/html.py index 609a0dee1c..b817236227 100644 --- a/src/calibre/ebooks/metadata/html.py +++ b/src/calibre/ebooks/metadata/html.py @@ -22,6 +22,7 @@ def get_metadata(stream): src = stream.read() return get_metadata_(src) + COMMENT_NAMES = { 'title': 'TITLE', 'authors': 'AUTHOR', @@ -102,7 +103,7 @@ def parse_comment_tags(src): def get_metadata_(src, encoding=None): # Meta data definitions as in - # http://www.mobileread.com/forums/showpost.php?p=712544&postcount=9 + # https://www.mobileread.com/forums/showpost.php?p=712544&postcount=9 if isbytestring(src): if not encoding: diff --git a/src/calibre/ebooks/metadata/kfx.py b/src/calibre/ebooks/metadata/kfx.py index fedb5a9a5e..8015f58cb0 100644 --- a/src/calibre/ebooks/metadata/kfx.py +++ b/src/calibre/ebooks/metadata/kfx.py @@ -6,7 +6,7 @@ from __future__ import (unicode_literals, division, absolute_import, print_function) # Based on work of John Howell reversing the KFX format -# http://www.mobileread.com/forums/showpost.php?p=3176029&postcount=89 +# https://www.mobileread.com/forums/showpost.php?p=3176029&postcount=89 import struct, sys, base64, re from collections import defaultdict @@ -23,6 +23,7 @@ from calibre.utils.imghdr import identify class InvalidKFX(ValueError): pass + # magic numbers for data structures CONTAINER_MAGIC = b'CONT' ENTITY_MAGIC = b'ENTY' @@ -326,6 +327,7 @@ def read_metadata_kfx(stream, read_cover=True): return mi + if __name__ == '__main__': from calibre import prints with open(sys.argv[-1], 'rb') as f: diff --git a/src/calibre/ebooks/mobi/reader/mobi8.py b/src/calibre/ebooks/mobi/reader/mobi8.py index edc2426355..a3730daa4d 100644 --- a/src/calibre/ebooks/mobi/reader/mobi8.py +++ b/src/calibre/ebooks/mobi/reader/mobi8.py @@ -334,7 +334,7 @@ class Mobi8Reader(object): return m.group(1) # For some files, kindlegen apparently creates links to tags # without HTML anchors, using the AID instead. See - # See http://www.mobileread.com/forums/showthread.php?t=259557 + # See https://www.mobileread.com/forums/showthread.php?t=259557 m = self.aid_re.match(tag) if m is not None: self.linked_aids.add(m.group(1)) diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index 7bf06b28eb..6924a509b0 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -108,7 +108,7 @@ def init_qt(args): except Exception: is_x11 = False # Ancient broken VNC servers cannot handle icons of size greater than 256 - # http://www.mobileread.com/forums/showthread.php?t=278447 + # https://www.mobileread.com/forums/showthread.php?t=278447 ic = 'lt.png' if is_x11 else 'library.png' app.setWindowIcon(QIcon(I(ic, allow_user_override=False))) return app, opts, args @@ -432,6 +432,7 @@ def run_gui(opts, args, listener, app, gui_debug=None): open_local_file(debugfile) return ret + singleinstance_name = 'calibre_GUI' @@ -592,5 +593,3 @@ if __name__ == '__main__': '%sLog:
%s')%(unicode(err), unicode(tb).replace('\n', '
'), log.replace('\n', '
'))) - - diff --git a/src/calibre/gui2/store/stores/mobileread/cache_update_thread.py b/src/calibre/gui2/store/stores/mobileread/cache_update_thread.py index e9df195878..d7a8036ecd 100644 --- a/src/calibre/gui2/store/stores/mobileread/cache_update_thread.py +++ b/src/calibre/gui2/store/stores/mobileread/cache_update_thread.py @@ -38,7 +38,7 @@ class CacheUpdateThread(Thread, QObject): self._run = False def run(self): - url = 'http://www.mobileread.com/forums/ebooks.php?do=getlist&type=html' + url = 'https://www.mobileread.com/forums/ebooks.php?do=getlist&type=html' self.update_details.emit(_('Checking last download date.')) last_download = self.config.get('last_download', None) diff --git a/src/calibre/gui2/store/stores/mobileread/mobileread_plugin.py b/src/calibre/gui2/store/stores/mobileread/mobileread_plugin.py index b60290b636..60f2daa019 100644 --- a/src/calibre/gui2/store/stores/mobileread/mobileread_plugin.py +++ b/src/calibre/gui2/store/stores/mobileread/mobileread_plugin.py @@ -40,7 +40,7 @@ class MobileReadStore(BasicStoreConfig, StorePlugin): return self._mr_cache def open(self, parent=None, detail_item=None, external=False): - url = 'http://www.mobileread.com/' + url = 'https://www.mobileread.com/' if external or self.config.get('open_external', False): open_url(QUrl(detail_item if detail_item else url)) diff --git a/src/calibre/gui2/viewer/config.ui b/src/calibre/gui2/viewer/config.ui index 11d8591a1f..fc705c74e0 100644 --- a/src/calibre/gui2/viewer/config.ui +++ b/src/calibre/gui2/viewer/config.ui @@ -917,7 +917,7 @@ You must enter the search URL for the search engine, with the placeholder - <p>A CSS stylesheet that can be used to control the look and feel of books. For examples, click <a href="http://www.mobileread.com/forums/showthread.php?t=51500">here</a>. + <p>A CSS stylesheet that can be used to control the look and feel of books. For examples, click <a href="https://www.mobileread.com/forums/showthread.php?t=51500">here</a>. true diff --git a/src/calibre/library/server/base.py b/src/calibre/library/server/base.py index e80a274f89..4d15cbb0a5 100644 --- a/src/calibre/library/server/base.py +++ b/src/calibre/library/server/base.py @@ -49,7 +49,7 @@ class DispatchController(object): # {{{ route = self.prefix + route if isinstance(route, unicode): # Apparently the routes package chokes on unicode routes, see - # http://www.mobileread.com/forums/showthread.php?t=235366 + # https://www.mobileread.com/forums/showthread.php?t=235366 route = route.encode('utf-8') elif self.prefix: self.dispatcher.connect(name+'prefix_extra', self.prefix, self, @@ -116,6 +116,7 @@ class BonJour(SimplePlugin): # {{{ stop.priority = 10 + cherrypy.engine.bonjour = BonJour(cherrypy.engine) # }}} diff --git a/src/calibre/utils/img.py b/src/calibre/utils/img.py index 2bd3687513..75e324ad07 100644 --- a/src/calibre/utils/img.py +++ b/src/calibre/utils/img.py @@ -10,16 +10,13 @@ from threading import Thread from PyQt5.Qt import QImage, QByteArray, QBuffer, Qt, QImageReader, QColor, QImageWriter, QTransform, QPixmap from calibre import fit_image, force_unicode -from calibre.constants import iswindows, plugins, get_version +from calibre.constants import iswindows, plugins from calibre.utils.config_base import tweaks from calibre.utils.filenames import atomic_rename # Utilities {{{ imageops, imageops_err = plugins['imageops'] if imageops is None: - if '*' in get_version(): - raise RuntimeError('You are running from source, which requires the new binary module, imageops. You can' - ' get it by installing the betas from: http://www.mobileread.com/forums/showthread.php?t=274030') raise RuntimeError(imageops_err) diff --git a/src/calibre/utils/winreg/default_programs.py b/src/calibre/utils/winreg/default_programs.py index c35a378456..c620df4c67 100644 --- a/src/calibre/utils/winreg/default_programs.py +++ b/src/calibre/utils/winreg/default_programs.py @@ -51,7 +51,7 @@ def extensions(basename): if basename == 'calibre.exe': from calibre.ebooks import BOOK_EXTENSIONS # We remove rar and zip as they interfere with 7-zip associations - # http://www.mobileread.com/forums/showthread.php?t=256459 + # https://www.mobileread.com/forums/showthread.php?t=256459 return set(BOOK_EXTENSIONS) - {'rar', 'zip'} if basename == 'ebook-viewer.exe': from calibre.customize.ui import all_input_formats @@ -222,6 +222,7 @@ def get_open_data(base, prog_id): cmd = ' '.join(parts[:-1]) + ' "%1"' return cmd, k.get(sub_key='DefaultIcon'), k.get_mui_string('FriendlyTypeName') or k.get() + CommandLineToArgvW = ctypes.windll.shell32.CommandLineToArgvW CommandLineToArgvW.arg_types = [LPCWSTR, ctypes.POINTER(ctypes.c_int)] CommandLineToArgvW.restype = ctypes.POINTER(LPCWSTR) @@ -309,6 +310,7 @@ def find_programs(extensions): ans.append({'name':name, 'cmdline':cmdline, 'icon_resource':icon_resource}) return ans + if __name__ == '__main__': from pprint import pprint pprint(find_programs('docx'.split()))