Consistent package name for smarts

This commit is contained in:
Kovid Goyal 2014-11-21 14:50:03 +05:30
parent 8e287bfac2
commit 872827f817
5 changed files with 6 additions and 6 deletions

View File

@ -6,7 +6,7 @@ from __future__ import (unicode_literals, division, absolute_import,
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
from calibre.gui2.tweak_book.editor.smart import NullSmarts
from calibre.gui2.tweak_book.editor.smarts import NullSmarts
def find_rule(raw, rule_address):
import tinycss

View File

@ -17,7 +17,7 @@ from calibre.gui2 import error_dialog
from calibre.gui2.tweak_book.editor.syntax.html import ATTR_NAME, ATTR_END, ATTR_START, ATTR_VALUE
from calibre.utils.icu import utf16_length
from calibre.gui2.tweak_book import tprefs
from calibre.gui2.tweak_book.editor.smart import NullSmarts
from calibre.gui2.tweak_book.editor.smarts import NullSmarts
get_offset = itemgetter(0)
PARAGRAPH_SEPARATOR = '\u2029'

View File

@ -10,7 +10,7 @@ import re
from PyQt5.Qt import Qt
from calibre.gui2.tweak_book.editor.smart import NullSmarts
from calibre.gui2.tweak_book.editor.smarts import NullSmarts
def get_text_before_cursor(editor):
cursor = editor.textCursor()

View File

@ -23,7 +23,7 @@ from calibre.gui2.tweak_book.editor import (
SYNTAX_PROPERTY, SPELL_PROPERTY, SPELL_LOCALE_PROPERTY, store_locale, LINK_PROPERTY)
from calibre.gui2.tweak_book.editor.themes import get_theme, theme_color, theme_format
from calibre.gui2.tweak_book.editor.syntax.base import SyntaxHighlighter
from calibre.gui2.tweak_book.editor.smart import NullSmarts
from calibre.gui2.tweak_book.editor.smarts import NullSmarts
from calibre.spell.break_iterator import index_of
from calibre.utils.icu import safe_chr, string_length, capitalize, upper, lower, swapcase
from calibre.utils.titlecase import titlecase
@ -40,7 +40,7 @@ def get_highlighter(syntax):
def get_smarts(syntax):
smartsname = {'xml':'html'}.get(syntax, syntax)
try:
return importlib.import_module('calibre.gui2.tweak_book.editor.smart.' + smartsname).Smarts
return importlib.import_module('calibre.gui2.tweak_book.editor.smarts.' + smartsname).Smarts
except (ImportError, AttributeError):
pass
@ -814,7 +814,7 @@ class TextEdit(PlainTextEdit):
return self.selected_text_from_cursor(c)
def goto_css_rule(self, rule_address, sourceline_address=None):
from calibre.gui2.tweak_book.editor.smart.css import find_rule
from calibre.gui2.tweak_book.editor.smarts.css import find_rule
block = None
if self.syntax == 'css':
raw = unicode(self.toPlainText())