Skip to content

Commit 84af474

Browse files
committed
enable customization of table borders in myclirc
Styling table borders with a Pygments style turns out to have been already implemented in cli_helpers, per * https://github.com/dbcli/cli_helpers/blob/9fb9f656ea8f4ab8230c2e4633526791d2d7438e/cli_helpers/tabular_output/tabulate_adapter.py#L163 In the mycli project, we just need to define Token.Output.TableSeparator and make it configurable by the user in ~/.myclirc.
1 parent 7cdac2e commit 84af474

4 files changed

Lines changed: 7 additions & 0 deletions

File tree

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Features
99
* Allow customization of the toolbar with prompt format strings.
1010
* Add warnings-count prompt format strings: `\w` and `\W`.
1111
* Handle/document more attributes in the `[colors]` section of `~/.myclirc`.
12+
* Enable customization of table border color/attributes in `~/.myclirc`.
1213

1314

1415
Bug Fixes

mycli/clistyle.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@
3232
Token.Toolbar.Arg.Text: "arg-toolbar.text",
3333
Token.Toolbar.Transaction.Valid: "bottom-toolbar.transaction.valid",
3434
Token.Toolbar.Transaction.Failed: "bottom-toolbar.transaction.failed",
35+
Token.Output.TableSeparator: "output.table-separator",
3536
Token.Output.Header: "output.header",
3637
Token.Output.OddRow: "output.odd-row",
3738
Token.Output.EvenRow: "output.even-row",
3839
Token.Output.Null: "output.null",
3940
Token.Output.Status: "output.status",
4041
Token.Output.Timing: "output.timing",
42+
Token.Warnings.TableSeparator: "warnings.table-separator",
4143
Token.Warnings.Header: "warnings.header",
4244
Token.Warnings.OddRow: "warnings.odd-row",
4345
Token.Warnings.EvenRow: "warnings.even-row",

mycli/myclirc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,14 @@ prompt = ''
264264
continuation = ''
265265

266266
# style classes for colored table output
267+
output.table-separator = ""
267268
output.header = "#00ff5f bold"
268269
output.odd-row = ""
269270
output.even-row = ""
270271
output.null = "#808080"
271272
output.status = ""
272273
output.timing = ""
274+
warnings.table-separator = ""
273275
warnings.header = "#00ff5f bold"
274276
warnings.odd-row = ""
275277
warnings.even-row = ""

test/myclirc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,14 @@ prompt = ''
262262
continuation = ''
263263

264264
# style classes for colored table output
265+
output.table-separator = ""
265266
output.header = "#00ff5f bold"
266267
output.odd-row = ""
267268
output.even-row = ""
268269
output.null = "#808080"
269270
output.status = ""
270271
output.timing = ""
272+
warnings.table-separator = ""
271273
warnings.header = "#00ff5f bold"
272274
warnings.odd-row = ""
273275
warnings.even-row = ""

0 commit comments

Comments
 (0)