diff --git a/src/calibre/gui2/tweak_book/editor/smart/__init__.py b/src/calibre/gui2/tweak_book/editor/smarts/__init__.py similarity index 100% rename from src/calibre/gui2/tweak_book/editor/smart/__init__.py rename to src/calibre/gui2/tweak_book/editor/smarts/__init__.py diff --git a/src/calibre/gui2/tweak_book/editor/smart/css.py b/src/calibre/gui2/tweak_book/editor/smarts/css.py similarity index 92% rename from src/calibre/gui2/tweak_book/editor/smart/css.py rename to src/calibre/gui2/tweak_book/editor/smarts/css.py index 6268ed9e62..051f31c749 100644 --- a/src/calibre/gui2/tweak_book/editor/smart/css.py +++ b/src/calibre/gui2/tweak_book/editor/smarts/css.py @@ -6,7 +6,7 @@ from __future__ import (unicode_literals, division, absolute_import, __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal ' -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 diff --git a/src/calibre/gui2/tweak_book/editor/smart/html.py b/src/calibre/gui2/tweak_book/editor/smarts/html.py similarity index 99% rename from src/calibre/gui2/tweak_book/editor/smart/html.py rename to src/calibre/gui2/tweak_book/editor/smarts/html.py index ba2b1344c6..61e873b235 100644 --- a/src/calibre/gui2/tweak_book/editor/smart/html.py +++ b/src/calibre/gui2/tweak_book/editor/smarts/html.py @@ -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' diff --git a/src/calibre/gui2/tweak_book/editor/smart/python.py b/src/calibre/gui2/tweak_book/editor/smarts/python.py similarity index 98% rename from src/calibre/gui2/tweak_book/editor/smart/python.py rename to src/calibre/gui2/tweak_book/editor/smarts/python.py index 5e285960e8..6ce3701f04 100644 --- a/src/calibre/gui2/tweak_book/editor/smart/python.py +++ b/src/calibre/gui2/tweak_book/editor/smarts/python.py @@ -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() diff --git a/src/calibre/gui2/tweak_book/editor/text.py b/src/calibre/gui2/tweak_book/editor/text.py index a8b8040e19..a4c3206d6b 100644 --- a/src/calibre/gui2/tweak_book/editor/text.py +++ b/src/calibre/gui2/tweak_book/editor/text.py @@ -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())