From bce1a38322327256ad2b718269d43371236d0bb7 Mon Sep 17 00:00:00 2001 From: Martin Vilcans Date: Tue, 15 Nov 2011 23:05:09 +0100 Subject: Fixed bold/underline etc. in FDX. (Capitalization mistake.) --- screenplain/export/fdx.py | 4 ++-- tests/fdx_test.py | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/screenplain/export/fdx.py b/screenplain/export/fdx.py index 3644714..b2d2d87 100644 --- a/screenplain/export/fdx.py +++ b/screenplain/export/fdx.py @@ -17,13 +17,13 @@ def _write_text_element(out, styles, text): if style_value == '': out.write(' %s\n' % (escape(text))) else: - out.write(' %s\n' % + out.write(' %s\n' % (style_value, escape(text)) ) def write_text(out, rich, trailing_linebreak): - """Writes elements.""" + """Writes elements.""" for seg_no, segment in enumerate(rich.segments): fdx_styles = set(style_names[n] for n in segment.styles) if trailing_linebreak and seg_no == len(rich.segments) - 1: diff --git a/tests/fdx_test.py b/tests/fdx_test.py index d97782f..1e2c743 100644 --- a/tests/fdx_test.py +++ b/tests/fdx_test.py @@ -21,7 +21,7 @@ class OutputTests(unittest2.TestCase): write_text(self.out, bold('hello'), False) self.assertEqual( self.out.getvalue(), - ' hello\n' + ' hello\n' ) def test_sequential_styles(self): @@ -30,8 +30,8 @@ class OutputTests(unittest2.TestCase): self.assertEqual( self.out.getvalue(), ' plain\n' - ' b\n' - ' i\n' + ' b\n' + ' i\n' ) def test_several_styles(self): @@ -39,9 +39,9 @@ class OutputTests(unittest2.TestCase): write_text(self.out, rich, False) self.assertEqual( self.out.getvalue(), - ' outer\n' - ' inner\n' - ' outer\n' + ' outer\n' + ' inner\n' + ' outer\n' ) def test_write_text_adds_line_break_if_requested(self): @@ -49,7 +49,7 @@ class OutputTests(unittest2.TestCase): write_text(self.out, rich, True) self.assertEqual( self.out.getvalue(), - ' outer\n' - ' inner\n' - ' outer\n\n' # note newline + ' outer\n' + ' inner\n' + ' outer\n\n' # note newline ) -- cgit v1.2.3