From c77548332f17d266047557acc48dfea974e9d3e2 Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Sat, 7 Apr 2018 09:14:43 +0200 Subject: [PATCH] Do not dump rst errors in the logfile. --- dpaste/highlight.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dpaste/highlight.py b/dpaste/highlight.py index a1ac97e..e54be34 100644 --- a/dpaste/highlight.py +++ b/dpaste/highlight.py @@ -87,6 +87,8 @@ class RestructuredTextHighlighter(PlainTextHighlighter): 'settings_overrides': { 'raw_enabled': False, 'file_insertion_enabled': False, + 'report_level': 3, + 'warning_stream': '/dev/null', } } @@ -96,6 +98,7 @@ class RestructuredTextHighlighter(PlainTextHighlighter): parts = publish_parts(**self.publish_args) return mark_safe(parts[self.rst_part_name]) + # ----------------------------------------------------------------------------- @@ -112,7 +115,7 @@ class PygmentsHighlighter(Highlighter): Highlight code string with Pygments. The lexer is automaticially determined by the lexer name. """ - formatter = NakedHtmlFormatter + formatter = NakedHtmlFormatter() lexer = None lexer_fallback = PythonLexer() @@ -124,7 +127,7 @@ class PygmentsHighlighter(Highlighter): logger.warning('Lexer for given name %s not found', lexer_name) self.lexer = self.lexer_fallback - return highlight(code_string, self.lexer, self.formatter()) + return highlight(code_string, self.lexer, self.formatter) class SolidityHighlighter(PygmentsHighlighter):