rosie lookup: quick improvements#2903
Conversation
| # h, v -> horizontal, vertical | ||
| # l, x -> line, cross (i.e. vertex) | ||
|
|
||
| # unicode (U_) chars |
There was a problem hiding this comment.
Heavily inspired by the Cylc --box format system.
Search the internet for "box drawing characters" for more info.
ff8f83f to
262d161
Compare
| print(table( | ||
| _rows, header=cols, max_width=terminal_cols, unicode=False | ||
| )) |
There was a problem hiding this comment.
Just in case someone tries to run this in a 1980s build of emacs or whatever.
| try: | ||
| terminal_cols = int(ws_client.popen("stty", "size")[0].split()[1]) | ||
| except (IndexError, RosePopenError, ValueError): | ||
| terminal_cols = None | ||
|
|
||
| if terminal_cols == 0: | ||
| terminal_cols = None |
There was a problem hiding this comment.
The stty size command just does not work when run via the Rose Popener module.
I did try hacking it, but I couldn't figure out what Popener was doing to aggravate stty and gave in.
d063d30 to
f34d090
Compare
b84417e to
163048a
Compare
wxtim
left a comment
There was a problem hiding this comment.
Happy that this will work as is. Happy to approve once you've decided what you want to do with the subprocess.
* Fix broken terminal width detection. * Change default format to a table
163048a to
5f47686
Compare
|
I've tested the |
|
What is causing the doc check failure? Sphinx is complaining about a dead link, but the link is fine. |
|
Hmm, I wonder if StackOverflow is protecting against web crawlers, perhaps our test looks a little fishy? The link has passed the test in the past and still seems to work. |
The
rosie lookupinterface is more important than it used to be due to the loss ofrosie go.However, the CLI help is not especially informative, especially on the query format.
Additionally, the tabulated output suffers from line wrapping which makes it very hard to read.
This is a quick slapdash attempt to improve the situation for users.
This PR:
--no-prettyoption to see the old format.