[go: nahoru, domu]

Skip to content
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

Monitor subcommand: interactivity improvements #272

Merged

Conversation

andlaus
Copy link
Member
@andlaus andlaus commented Feb 5, 2021

This PR mainly improves the interactivity of the monitor subcommand to make it feel much more "less-like" and to make editing the filter regular expression much more convenient. Besides this, the last patch changes the instructions in README.rst to use python3 -m cantools instead of cantools on the CLI, because the latter does not always seem to work. Please yell at me if you want to have that patch reverted.

Andreas Lauser andreas.lauser@mbition.io, Mercedes-Benz AG on behalf of MBition GmbH.

Imprint

@eerimoq
Copy link
Collaborator
eerimoq commented Feb 5, 2021

I agree that it's a good idea to replace cantools with python3 -m cantools. We should replace pip install cantools with python3 -m pip install cantools as well. On windows it's usually py -3 -m cantools, but can't take all environments into account, so lets stick to python3 -m ....

@eerimoq
Copy link
Collaborator
eerimoq commented Feb 5, 2021

I've actually not used cantools myself in quite a while and I can't recall how the monitor user experience was. I trust that your change is good for the majority of the users. I will not try it myself.

letting this parameter default to True makes the test much easier to
debug because things are printed where something goes wrong instead of
at the end and the formatting of the expected and the actual results
is identical to enable easy comparison using a diff tool.

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Oliver Kopp <oliver.kopp@mbition.io>
in contrast to an iteratable, we do not need to know how often the
method is called using this approach and what the result of a given
call is. In some sense, we now actually test something...

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Oliver Kopp <oliver.kopp@mbition.io>
parsing large files takes a few seconds, so for the user it is nice to
know that something is going on.

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Oliver Kopp <oliver.kopp@mbition.io>
this avoids messing up the filter string with stuff like KEY_LEFT,
KEY_RIGHT, etc. In the medium term, it might be a good idea to use
something like the readline library for the input of the filter
string.

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Oliver Kopp <oliver.kopp@mbition.io>
Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Oliver Kopp <oliver.kopp@mbition.io>
the cursor can be moved, and characters can be deleted in the middle
of the filter string using the backspace and delete keys.

Still, switching this to something more sophisticated like GNU
readline would be beneficial IMO.

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Oliver Kopp <oliver.kopp@mbition.io>
Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Oliver Kopp <oliver.kopp@mbition.io>
… filter regex

IMO this is more intuitive than disabling filtering.

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Oliver Kopp <oliver.kopp@mbition.io>
Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Oliver Kopp <oliver.kopp@mbition.io>
this is quite useful for messages that contain many signals.

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Oliver Kopp <oliver.kopp@mbition.io>
this issue got much more pronounced with the introduction of
single-line scrolling.

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Oliver Kopp <oliver.kopp@mbition.io>
This ought to be the same anyway, but at least on my machine, running
`setup.py install` does not install an executable called
`cantools`. The same might be true for `pip`. Note that this only
fixes the instructions for people who use a UNIX-like operating
system, on Windows the name of the python interpreter might be
different. Thanks to [at]eerimoq for the review comments.

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Oliver Kopp <oliver.kopp@mbition.io>
@andlaus andlaus force-pushed the monitor_interactivity_improvements branch from 729d96c to 2441a91 Compare February 9, 2021 10:11
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.5%) to 96.529% when pulling 2441a91 on Daimler:monitor_interactivity_improvements into e7d8a31 on eerimoq:master.

@andlaus
Copy link
Member Author
andlaus commented Feb 9, 2021

ok. fixing the tests was quite elaborate, mainly because I initially had serious issues understanding the error messages. I also did not extend the tests to check for every single new interactive behavior as this would IMO be a bit too excessive.

@eerimoq eerimoq merged commit a5029b5 into cantools:master Feb 9, 2021
@andlaus andlaus deleted the monitor_interactivity_improvements branch December 11, 2021 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants