예제 #1
0
파일: __init__.py 프로젝트: siebert/calibre
def editor_from_syntax(syntax, parent=None):
    if syntax in {'text', 'html', 'css', 'xml'}:
        from calibre.gui2.tweak_book.editor.widget import Editor
        return Editor(syntax, parent=parent)
    elif syntax == 'raster_image':
        from calibre.gui2.tweak_book.editor.image import Editor
        return Editor(syntax, parent=parent)
예제 #2
0
def editor_from_syntax(syntax, parent=None):
    if syntax in all_text_syntaxes:
        from calibre.gui2.tweak_book.editor.widget import Editor
        return Editor(syntax, parent=parent)
    elif syntax == 'raster_image':
        from calibre.gui2.tweak_book.editor.image import Editor
        return Editor(syntax, parent=parent)
예제 #3
0
def editor_from_syntax(syntax, parent=None):
    if syntax not in {'text', 'html', 'css', 'xml'}:
        return None
    from calibre.gui2.tweak_book.editor.widget import Editor
    return Editor(syntax, parent=parent)