-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust gridtk list output to fit terminal width #15
base: main
Are you sure you want to change the base?
Conversation
Fixes #13 Adjust the `gridtk list` output to fit terminal width and add a `--full-output` option. * **src/gridtk/cli.py** - Update the `list_jobs` function to adjust column widths based on terminal size. - Add logic to truncate long content with ellipses in the `list_jobs` function. - Add a new option `--full-output` to the `list_jobs` command to view the full output without truncation. * **tests/test_gridtk.py** - Add unit tests to verify the new behavior of the `gridtk list` command. - Add unit tests to verify the `--full-output` option for the `gridtk list` command. * **README.md** - Update the documentation to reflect the new behavior of the `gridtk list` command. - Add information about the `--full-output` option for the `gridtk list` command. * **.devcontainer.json** - Add a devcontainer configuration file with tasks for testing, building, and launching the project. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/idiap/gridtk/issues/13?shareId=XXXX-XXXX-XXXX-XXXX).
…mmand for improved readability Also, adjust max column widths for output formatting to accommodate new options
* truncates with only 2 dots * dynamically adjusts the command column to use all the width of the terminal
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must have missed the mail for that review.
This is a nice feature!
When testing it however, I noticed issues with both --wrap
and --truncate
options when using a small terminal width (<=87 for truncate, and <=95 for wrap). The total width somehow exceeds the width of the terminal and wraps some full lines (like the header separator).
With a terminal width of 95 and the --wrap
option. Notice the -
of the header separator and the t
of submit.
I think this is due to tabulate
adding some horizontal padding to some columns despite specifying their maxcolwidths
parameters.
Yes, I have found the output of tabulate quite unpreditable regarding this. Not sure what to do here. |
could you show a before and after photo? I am not sure I understand what changed. |
Fixes #13
Adjust the
gridtk list
output to fit terminal width and add a--full-output
option.src/gridtk/cli.py
list_jobs
function to adjust column widths based on terminal size.list_jobs
function.--full-output
to thelist_jobs
command to view the full output without truncation.tests/test_gridtk.py
gridtk list
command.--full-output
option for thegridtk list
command.README.md
gridtk list
command.--full-output
option for thegridtk list
command..devcontainer.json
For more details, open the Copilot Workspace session.
📚 Documentation preview 📚: https://gridtk--15.org.readthedocs.build/en/15/