From e9a5ecd77ff6d616f2ee70df6f97a856e775d66a Mon Sep 17 00:00:00 2001 From: Ales Erjavec Date: Mon, 18 Dec 2017 13:26:42 +0100 Subject: [PATCH] canvas/outputview: Fix class name (spelling) --- Orange/canvas/application/outputview.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Orange/canvas/application/outputview.py b/Orange/canvas/application/outputview.py index ac87a67a65f..7d4efe4ffbe 100644 --- a/Orange/canvas/application/outputview.py +++ b/Orange/canvas/application/outputview.py @@ -1,5 +1,6 @@ """ """ +import warnings import traceback from AnyQt.QtWidgets import QWidget, QPlainTextEdit, QVBoxLayout, QSizePolicy @@ -128,7 +129,7 @@ def formated(self, color=None, background=None, weight=None, self.currentCharFormat(), color, background, weight, italic, underline, font ) - return formater(self, charformat) + return Formatter(self, charformat) def update_char_format(baseformat, color=None, background=None, weight=None, @@ -180,7 +181,7 @@ def update_font(basefont, weight=None, italic=None, underline=None, return font -class formater(QObject): +class Formatter(QObject): def __init__(self, outputview, charformat): # type: (OutputView, QTextCharFormat) -> None # Parent to the output view. Ensure the formatter does not outlive it. @@ -204,7 +205,7 @@ def formated(self, color=None, background=None, weight=None, italic=None, underline=None, font=None): charformat = update_char_format(self.charformat, color, background, weight, italic, underline, font) - return formater(self.outputview, charformat) + return Formatter(self.outputview, charformat) def __enter__(self): return self @@ -215,6 +216,15 @@ def __exit__(self, *args): self.setParent(None) +class formater(Formatter): + def __init__(self, *args, **kwargs): + warnings.warn( + "Deprecated: Renamed to Formatter.", + DeprecationWarning, stacklevel=2 + ) + super().__init__(*args, **kwargs) + + class TextStream(QObject): stream = Signal(str) flushed = Signal()