mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
...
This commit is contained in:
parent
872827f817
commit
288c3a285f
@ -31,18 +31,20 @@ from calibre.utils.titlecase import titlecase
|
|||||||
PARAGRAPH_SEPARATOR = '\u2029'
|
PARAGRAPH_SEPARATOR = '\u2029'
|
||||||
|
|
||||||
def get_highlighter(syntax):
|
def get_highlighter(syntax):
|
||||||
try:
|
if syntax:
|
||||||
return importlib.import_module('calibre.gui2.tweak_book.editor.syntax.' + syntax).Highlighter
|
try:
|
||||||
except (ImportError, AttributeError):
|
return importlib.import_module('calibre.gui2.tweak_book.editor.syntax.' + syntax).Highlighter
|
||||||
pass
|
except (ImportError, AttributeError):
|
||||||
|
pass
|
||||||
return SyntaxHighlighter
|
return SyntaxHighlighter
|
||||||
|
|
||||||
def get_smarts(syntax):
|
def get_smarts(syntax):
|
||||||
smartsname = {'xml':'html'}.get(syntax, syntax)
|
if syntax:
|
||||||
try:
|
smartsname = {'xml':'html'}.get(syntax, syntax)
|
||||||
return importlib.import_module('calibre.gui2.tweak_book.editor.smarts.' + smartsname).Smarts
|
try:
|
||||||
except (ImportError, AttributeError):
|
return importlib.import_module('calibre.gui2.tweak_book.editor.smarts.' + smartsname).Smarts
|
||||||
pass
|
except (ImportError, AttributeError):
|
||||||
|
pass
|
||||||
|
|
||||||
_dff = None
|
_dff = None
|
||||||
def default_font_family():
|
def default_font_family():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user