From 4d88d056210688fecb7c7f5ec6e3716cf19f1f39 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 10 Mar 2015 10:14:50 +0530 Subject: [PATCH] Fix various User Manual and translation build warnings --- manual/custom.py | 2 +- src/calibre/ebooks/metadata/sources/base.py | 2 +- src/calibre/gui2/open_with.py | 2 +- src/calibre/gui2/tweak_book/reports.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/manual/custom.py b/manual/custom.py index 947bbdd903..95b72cf8aa 100644 --- a/manual/custom.py +++ b/manual/custom.py @@ -191,7 +191,7 @@ def render_options(cmd, groups, options_header=True, add_program=True): def mark_options(raw): raw = re.sub(r'(\s+)--(\s+)', r'\1``--``\2', raw) - raw = re.sub(r'(--[a-zA-Z0-9_=,-]+)', r':option:`\1`', raw) + raw = re.sub(r'(--[|()a-zA-Z0-9_=,-]+)', r':option:`\1`', raw) return raw def cli_docs(app): diff --git a/src/calibre/ebooks/metadata/sources/base.py b/src/calibre/ebooks/metadata/sources/base.py index b5b6498530..df71b96f48 100644 --- a/src/calibre/ebooks/metadata/sources/base.py +++ b/src/calibre/ebooks/metadata/sources/base.py @@ -492,7 +492,7 @@ class Source(Plugin): def get_book_urls(self, identifiers): ''' Override this method if you would like to return multiple urls for this book. - Return a list of 3-tuples. By default this method simply calls :method:`get_book_url`. + Return a list of 3-tuples. By default this method simply calls :func:`get_book_url`. ''' data = self.get_book_url(identifiers) if data is None: diff --git a/src/calibre/gui2/open_with.py b/src/calibre/gui2/open_with.py index 674d59527f..4791737550 100644 --- a/src/calibre/gui2/open_with.py +++ b/src/calibre/gui2/open_with.py @@ -398,7 +398,7 @@ def register_keyboard_shortcuts(gui=None, finalize=False): for application in applications: text = entry_to_icon_text(application, only_text=True) t = _('cover image') if filetype.upper() == 'COVER_IMAGE' else filetype.upper() - name = _('Open %s files with %s') % (t, text) + name = _('Open {0} files with {1}').format(t, text) ac = QAction(gui) unique_name = application['uuid'] ac.triggered.connect(partial(gui.open_with_action_triggerred, filetype, application)) diff --git a/src/calibre/gui2/tweak_book/reports.py b/src/calibre/gui2/tweak_book/reports.py index 0f7b9ef528..c68447dd19 100644 --- a/src/calibre/gui2/tweak_book/reports.py +++ b/src/calibre/gui2/tweak_book/reports.py @@ -925,7 +925,7 @@ class CSSRulesModel(QAbstractItemModel): if isinstance(entry, CSSEntry): return '[%{}d] %s'.format(self.num_size) % (entry.count, entry.rule.selector) elif isinstance(entry, CSSFileMatch): - return _('%s [%d elements]') % (entry.file_name, len(entry.locations)) + return _('{0} [{1} elements]').format(entry.file_name, len(entry.locations)) elif isinstance(entry, MatchLocation): return '%s @ %s' % (entry.tag, entry.sourceline) elif role == Qt.UserRole: @@ -1143,7 +1143,7 @@ class ClassesModel(CSSRulesModel): if isinstance(entry, ClassEntry): return '[%{}d] %s'.format(self.num_size) % (entry.num_of_matches, entry.cls) elif isinstance(entry, ClassFileMatch): - return _('%s [%d elements]') % (entry.file_name, len(entry.class_elements)) + return _('{0} [{1} elements]').format(entry.file_name, len(entry.class_elements)) elif isinstance(entry, ClassElement): return '%s @ %s' % (entry.tag, entry.line_number) elif isinstance(entry, CSSRule):