diff --git a/src/calibre/db/tests/reading.py b/src/calibre/db/tests/reading.py index 040bdeba3d..8dc85f4c66 100644 --- a/src/calibre/db/tests/reading.py +++ b/src/calibre/db/tests/reading.py @@ -854,6 +854,7 @@ def evaluate(book, ctx): return ','.join(list(ctx.helper_function(tags))) ''' from calibre.utils.formatter import PythonTemplateContext + class CustomContext(PythonTemplateContext): def helper_function(self, arg): s = set(arg) diff --git a/src/calibre/gui2/dialogs/template_dialog.py b/src/calibre/gui2/dialogs/template_dialog.py index 15c8e09ab5..2275192b36 100644 --- a/src/calibre/gui2/dialogs/template_dialog.py +++ b/src/calibre/gui2/dialogs/template_dialog.py @@ -208,7 +208,7 @@ class TemplateHighlighter(QSyntaxHighlighter): # we avoid thinking a # inside a string starts a comment. t = re.sub(self.stringRe, self.replace_strings_with_dash, text) sharp_pos = t.find('#') - if sharp_pos >= 0: # Do we still have a #? + if sharp_pos >= 0: # Do we still have a #? self.setFormat(sharp_pos, len(text), self.Formats["comment"]) self.setCurrentBlockState(NORMAL)