mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/cbhaley/calibre
This commit is contained in:
commit
2e49c2d129
@ -140,11 +140,16 @@ class DocViewer(Dialog):
|
|||||||
doc = func.doc if hasattr(func, 'doc') else ''
|
doc = func.doc if hasattr(func, 'doc') else ''
|
||||||
return doc.raw_text if self.english_cb.isChecked() and hasattr(doc, 'raw_text') else doc
|
return doc.raw_text if self.english_cb.isChecked() and hasattr(doc, 'raw_text') else doc
|
||||||
|
|
||||||
|
def no_doc_string(self):
|
||||||
|
if self.english_cb.isChecked():
|
||||||
|
return 'No documentation provided'
|
||||||
|
return _('No documentation provided')
|
||||||
|
|
||||||
def show_function(self, fname):
|
def show_function(self, fname):
|
||||||
self.last_operation = partial(self.show_function, fname)
|
self.last_operation = partial(self.show_function, fname)
|
||||||
bif = self.builtins[fname]
|
bif = self.builtins[fname]
|
||||||
if fname not in self.builtins or not bif.doc:
|
if fname not in self.builtins or not bif.doc:
|
||||||
self.set_html(self.header_line(fname) + ('No documentation provided'))
|
self.set_html(self.header_line(fname) + self.no_doc_string())
|
||||||
else:
|
else:
|
||||||
self.last_function = fname
|
self.last_function = fname
|
||||||
self.set_html(self.header_line(fname) +
|
self.set_html(self.header_line(fname) +
|
||||||
@ -162,11 +167,15 @@ class DocViewer(Dialog):
|
|||||||
try:
|
try:
|
||||||
doc = self.get_doc(self.builtins[name])
|
doc = self.get_doc(self.builtins[name])
|
||||||
if not doc:
|
if not doc:
|
||||||
a(_('No documentation provided'))
|
a(self.no_doc_string())
|
||||||
else:
|
else:
|
||||||
html = self.ffml.document_to_html(doc.strip(), name)
|
html = self.ffml.document_to_html(doc.strip(), name)
|
||||||
paren = html.find('(')
|
name_pos = html.find(name + '(')
|
||||||
html = f'<a href="ffdoc:{name}">{name}</a>{html[paren:]}'
|
if name_pos < 0:
|
||||||
|
rest_of_doc = ' -- ' + html
|
||||||
|
else:
|
||||||
|
rest_of_doc = html[name_pos + len(name):]
|
||||||
|
html = f'<a href="ffdoc:{name}">{name}</a>{rest_of_doc}'
|
||||||
a(html)
|
a(html)
|
||||||
except Exception:
|
except Exception:
|
||||||
print('Exception in', name)
|
print('Exception in', name)
|
||||||
|
@ -407,7 +407,6 @@ class BuiltinAdd(BuiltinFormatterFunction):
|
|||||||
argument is not a number. In most cases you can use the ``+`` operator instead
|
argument is not a number. In most cases you can use the ``+`` operator instead
|
||||||
of this function.
|
of this function.
|
||||||
''')
|
''')
|
||||||
# r'''No documentation provided''') # for debugging xlated text using French
|
|
||||||
|
|
||||||
def evaluate(self, formatter, kwargs, mi, locals, *args):
|
def evaluate(self, formatter, kwargs, mi, locals, *args):
|
||||||
res = 0
|
res = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user