Closed liiight closed 7 years ago
Can you provide a repr() of the output before and after your change? I'm not sure I 100% understand. Does your change change this:
>>> for line in PorcelainTable(table_data).table.splitlines(): repr(line)
...
"' Heading1 | Heading2 '"
"' row1 column1 | row1 column2 '"
"' row2 column1 | row2 column2 '"
"' row3 column1 | row3 column2 '"
to this:
>>> for line in PorcelainTable(table_data).table.splitlines(): repr(line)
...
"'Heading1 | Heading2'"
"'row1 column1 | row1 column2'"
"'row2 column1 | row2 column2'"
"'row3 column1 | row3 column2'"
@@ master #40 diff @@
========================================
Files 8 8
Lines 466 472 +6
Methods 0 0
Messages 0 0
Branches 77 79 +2
========================================
+ Hits 466 468 +2
- Misses 0 1 +1
- Partials 0 3 +3
Powered by Codecov. Last update ae22aaa...d25eaf9
Base:
Platform | Years | Notes
Mk5 | 2007-2009 | The Golf Mk5 Variant was
| | introduced in 2007.
MKVI | 2009-2013 | Might actually be Mk5.
table.horizontal_align = False
Platform|Years|Notes
Mk5|2007-2009|The Golf Mk5 Variant was
||introduced in 2007.
MKVI|2009-2013|Might actually be Mk5.
table.vertical_align = False
Platform|Years|Notes
Mk5|2007-2009|The Golf Mk5 Variant was\nintroduced in 2007.
MKVI|2009-2013|Might actually be Mk5.
I'm not sure if this would really be in scope of terminaltables. It's not really a table anymore, more like pipe delimited lines. What benefit would terminaltables provide over just ['|'.join(row) for row in table_data]
?
I understand this maybe too much of a private case and would understand if you reject this. For me, it's way more elegant to let terminaltable handle it by setting two flags than to have another code path.
Yea I think this would be too specific for terminaltables :( thanks for the pull request anyway, always glad to review this kind of stuff!
No problem. While we're at it, how you feel about a csv table?
To have it output something like:
Platform,Years,Notes
Mk5,2007-2009,The Golf Mk5 Variant was\nintroduced in 2007.
MKVI,2009-2013,Might actually be Mk5.
?
If so I think it too is out of scope. termintaltables is more for horizontal text alignment. If it's not padding cells it's basically just joining cells with a lot of function call overhead.
Yeah, guess you're right. Thanks for considering anyway.
With regard to https://github.com/Flexget/Flexget/issues/1584, our usage of PorcelainTable requires the ability to disable all table alignments.
To Do: