mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
...
This commit is contained in:
parent
872827f817
commit
288c3a285f
1 changed files with 11 additions and 9 deletions
|
|
@ -31,18 +31,20 @@
|
|||
PARAGRAPH_SEPARATOR = '\u2029'
|
||||
|
||||
def get_highlighter(syntax):
|
||||
try:
|
||||
return importlib.import_module('calibre.gui2.tweak_book.editor.syntax.' + syntax).Highlighter
|
||||
except (ImportError, AttributeError):
|
||||
pass
|
||||
if syntax:
|
||||
try:
|
||||
return importlib.import_module('calibre.gui2.tweak_book.editor.syntax.' + syntax).Highlighter
|
||||
except (ImportError, AttributeError):
|
||||
pass
|
||||
return SyntaxHighlighter
|
||||
|
||||
def get_smarts(syntax):
|
||||
smartsname = {'xml':'html'}.get(syntax, syntax)
|
||||
try:
|
||||
return importlib.import_module('calibre.gui2.tweak_book.editor.smarts.' + smartsname).Smarts
|
||||
except (ImportError, AttributeError):
|
||||
pass
|
||||
if syntax:
|
||||
smartsname = {'xml':'html'}.get(syntax, syntax)
|
||||
try:
|
||||
return importlib.import_module('calibre.gui2.tweak_book.editor.smarts.' + smartsname).Smarts
|
||||
except (ImportError, AttributeError):
|
||||
pass
|
||||
|
||||
_dff = None
|
||||
def default_font_family():
|
||||
|
|
|
|||
Loading…
Reference in a new issue