From 7ea39f3a4bd57a08023fce17ee010dc579d91b60 Mon Sep 17 00:00:00 2001 From: eladeyal Date: Sat, 25 May 2019 12:14:19 +0300 Subject: [PATCH] more pythonic --- gooey/gui/components/widgets/richtextconsole.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/gooey/gui/components/widgets/richtextconsole.py b/gooey/gui/components/widgets/richtextconsole.py index 2d36c1d..d73ea67 100644 --- a/gooey/gui/components/widgets/richtextconsole.py +++ b/gooey/gui/components/widgets/richtextconsole.py @@ -43,14 +43,13 @@ class RichTextConsole(wx.richtext.RichTextCtrl): self.end = colored.style.END self.noop = lambda *args, **kwargs: None - self.actionsMap = dict() - - # Supported font altering actions - self.actionsMap[colored.style.BOLD] = self.BeginBold - self.actionsMap[colored.style.RES_BOLD] = self.EndBold - self.actionsMap[colored.style.UNDERLINED] = self.BeginUnderline - self.actionsMap[colored.style.RES_UNDERLINED] = self.EndUnderline - self.actionsMap[colored.style.RESET] = self.EndAllStyles + self.actionsMap = { + colored.style.BOLD: self.BeginBold, + colored.style.RES_BOLD: self.EndBold, + colored.style.UNDERLINED: self.BeginUnderline, + colored.style.RES_UNDERLINED: self.EndUnderline, + colored.style.RESET: self.EndAllStyles, + } # Actions for coloring text for index, hex in enumerate(kColorList):