# HG changeset patch # User Paul Boddie # Date 1450566360 -3600 # Node ID fbbdfe6014732a9f0ded290c8a197837887a551e # Parent 4ad13e4380a9411dff1d5bee4102d0106d84d421 Minor help and test updates. diff -r 4ad13e4380a9 -r fbbdfe601473 pages/HelpOnImprovedTableParser --- a/pages/HelpOnImprovedTableParser Mon Feb 23 23:25:43 2015 +0100 +++ b/pages/HelpOnImprovedTableParser Sun Dec 20 00:06:00 2015 +0100 @@ -263,7 +263,7 @@ || Amstrad CPC464 || 64K || 32K || 1984 || 249 (green screen), 349 (colour) || || Amstrad CPC6128 || 128K || 48K || 1985 || 299 (colour) || || Sinclair ZX81 || 1K || 16K || 8K || 1981 || 70 (assembled), 50 (kit) || -|| VIC-20 || 5K || 32K || 16K || 1980 || 200 (estimated) || +|| VIC-20 || 5K || 32K || 16K || 1980 || 199 || Here is how it is written in the default table syntax: @@ -276,7 +276,7 @@ || Amstrad CPC464 || 64K || 32K || 1984 || 249 (green screen), 349 (colour) || || Amstrad CPC6128 || 128K || 48K || 1985 || 299 (colour) || || Sinclair ZX81 || 1K || 16K || 8K || 1981 || 70 (assembled), 50 (kit) || -|| VIC-20 || 5K || 32K || 16K || 1980 || 200 (estimated) || +|| VIC-20 || 5K || 32K || 16K || 1980 || 199 || }}} Although the lines are not too long, it is somewhat difficult to interpret and edit the text. @@ -331,7 +331,7 @@ || 70 (assembled), 50 (kit) == VIC-20 || 5K || 32K || 16K || 1980 -|| 200 (estimated) +|| 199 }}} }}}} @@ -384,7 +384,7 @@ || 70 (assembled), 50 (kit) == VIC-20 || 5K || 32K || 16K || 1980 -|| 200 (estimated) +|| 199 }}} === Adding Table Sorting === @@ -453,7 +453,7 @@ || 70 (assembled), 50 (kit) == VIC-20 || 5K || 32K || 16K || 1980 -|| 200 (estimated) +|| 199 }}} By pointing to the header cells, a pop-up dialogue allows the sorting criteria to be edited. diff -r 4ad13e4380a9 -r fbbdfe601473 tests/test_table.py --- a/tests/test_table.py Mon Feb 23 23:25:43 2015 +0100 +++ b/tests/test_table.py Sun Dec 20 00:06:00 2015 +0100 @@ -47,17 +47,19 @@ == A test || Of... ...non-continuation +== +<> """ attrs, rows = parse(table) -expected = 13 +expected = 14 print table print attrs print rows print len(rows) == expected, ": length is", len(rows), "==", expected print -for (row_attrs, columns), expected in zip(rows, [3, 2, 3, 3, 3, 2, 2, 2, 3, 3, 2, 2, 2]): +for (row_attrs, columns), expected in zip(rows, [3, 2, 3, 3, 3, 2, 2, 2, 3, 3, 2, 2, 2, 1]): print row_attrs print columns non_continuation_columns = [ @@ -78,4 +80,8 @@ text = rows[12][1][1][1] print text == expected_text, ": text is", repr(text) +expected_text = "\n<>\n" +text = rows[13][1][0][1] +print text == expected_text, ": text is", repr(text) + # vim: tabstop=4 expandtab shiftwidth=4