Skip to content

Commit

Permalink
canvas/outputview: Fix class name (spelling)
Browse files Browse the repository at this point in the history
  • Loading branch information
ales-erjavec committed Dec 20, 2017
1 parent 24e8b43 commit e9a5ecd
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Orange/canvas/application/outputview.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""
"""
import warnings
import traceback

from AnyQt.QtWidgets import QWidget, QPlainTextEdit, QVBoxLayout, QSizePolicy
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit e9a5ecd

Please sign in to comment.