diff options
author | Martin Vilcans <martin@librador.com> | 2014-09-03 15:47:16 +0200 |
---|---|---|
committer | Martin Vilcans <martin@librador.com> | 2014-09-03 15:47:16 +0200 |
commit | 8ee8e6158284e2c3f776c814c62fe17b4eebc969 (patch) | |
tree | 05783e230239b04f016ba04e40a785a08cca37d2 | |
parent | 0202bad44c99a5ccba793d97fc6debc130a32576 (diff) | |
download | screenplain-8ee8e6158284e2c3f776c814c62fe17b4eebc969.tar.gz |
Code consistency using _CreateStyledString
-rw-r--r-- | screenplain/richstring.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/screenplain/richstring.py b/screenplain/richstring.py index a72f948..06adf50 100644 --- a/screenplain/richstring.py +++ b/screenplain/richstring.py @@ -192,7 +192,7 @@ class _CreateStyledString(object): with a single segment with a specified style. """ def __init__(self, styles): - self.styles = styles + self.styles = set(styles) def __call__(self, text): return RichString(Segment(text, self.styles)) @@ -200,9 +200,9 @@ class _CreateStyledString(object): def __add__(self, other): return _CreateStyledString(self.styles.union(other.styles)) -plain = _CreateStyledString(set()) -bold = _CreateStyledString(set((Bold,))) -italic = _CreateStyledString(set((Italic,))) +plain = _CreateStyledString(()) +bold = _CreateStyledString((Bold,)) +italic = _CreateStyledString((Italic,)) underline = _CreateStyledString((Underline,)) empty_string = RichString() |