diff --git a/calibre-plugin/basicinihighlighter.py b/calibre-plugin/basicinihighlighter.py index 07f169b3..1c9d9fd8 100644 --- a/calibre-plugin/basicinihighlighter.py +++ b/calibre-plugin/basicinihighlighter.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from __future__ import (unicode_literals, division, +from __future__ import (absolute_import, unicode_literals, division, print_function) __license__ = 'GPL v3' @@ -23,11 +23,11 @@ class BasicIniHighlighter(QSyntaxHighlighter): format, so I'm leaving this in the project even though I'm not using. ''' - + def __init__( self, parent, theme ): QSyntaxHighlighter.__init__( self, parent ) self.parent = parent - + self.highlightingRules = [] # keyword @@ -61,4 +61,3 @@ class HighlightingRule(): brush = QBrush(color, style) charfmt.setForeground(brush) self.highlight = charfmt - diff --git a/calibre-plugin/dialogs.py b/calibre-plugin/dialogs.py index b43a6025..781877b4 100644 --- a/calibre-plugin/dialogs.py +++ b/calibre-plugin/dialogs.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from __future__ import (unicode_literals, division, +from __future__ import (absolute_import, unicode_literals, division, print_function) __license__ = 'GPL v3' @@ -74,7 +74,7 @@ from calibre_plugins.fanficfare_plugin.fanficfare.configurable \ import (get_valid_sections, get_valid_entries, get_valid_keywords, get_valid_entry_keywords) -from inihighlighter import IniHighlighter +from .inihighlighter import IniHighlighter ## moved to prefs.py so they can be included in jobs.py. from calibre_plugins.fanficfare_plugin.prefs import \ @@ -1370,7 +1370,7 @@ class IniTextDialog(SizePersistedDialog): self.resize_dialog() def accept(self): - from fff_util import test_config + from .fff_util import test_config # print("in accept") errors = test_config(self.get_plain_text()) diff --git a/calibre-plugin/inihighlighter.py b/calibre-plugin/inihighlighter.py index 4c80ad48..eb173734 100644 --- a/calibre-plugin/inihighlighter.py +++ b/calibre-plugin/inihighlighter.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from __future__ import (unicode_literals, division, +from __future__ import (absolute_import, unicode_literals, division, print_function) __license__ = 'GPL v3' @@ -19,11 +19,11 @@ class IniHighlighter(QSyntaxHighlighter): QSyntaxHighlighter class for use with QTextEdit for highlighting ini config files. ''' - + def __init__( self, parent, sections=[], keywords=[], entries=[], entry_keywords=[] ): QSyntaxHighlighter.__init__( self, parent ) self.parent = parent - + self.highlightingRules = [] if entries: @@ -33,7 +33,7 @@ class IniHighlighter(QSyntaxHighlighter): # true/false -- just to be nice. self.highlightingRules.append( HighlightingRule( r"\b(true|false)\b", Qt.darkGreen ) ) - + # *all* keywords -- change known later. self.errorRule = HighlightingRule( r"^[^:=\s][^:=]*[:=]", Qt.red ) self.highlightingRules.append( self.errorRule ) @@ -70,7 +70,7 @@ class IniHighlighter(QSyntaxHighlighter): # NOT comments -- but can be custom columns, so don't flag. #self.highlightingRules.append( HighlightingRule( r"(?