-
Notifications
You must be signed in to change notification settings - Fork 630
Add changed byte highlighting to viewer.py #1159
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
Conversation
Added optional byte highlighting that can be toggled using the shortcut key 'h'
Fix for the following error since the introduction of #1151 / #1142 Traceback (most recent call last): File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/pi/python-can/can/viewer.py", line 582, in <module> main() File "/home/pi/python-can/can/viewer.py", line 573, in main bus = _create_bus(parsed_args, **additional_config, app_name="python-can viewer") File "/home/pi/python-can/can/logger.py", line 105, in _create_bus if parsed_args.app_name: AttributeError: 'Namespace' object has no attribute 'app_name'
update viewer documentations
arrange keyboard shortcuts into bulleted list
Codecov Report
@@ Coverage Diff @@
## develop #1159 +/- ##
===========================================
+ Coverage 70.81% 70.83% +0.02%
===========================================
Files 79 79
Lines 7737 7757 +20
===========================================
+ Hits 5479 5495 +16
- Misses 2258 2262 +4 |
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.
Cool feature! Thanks for the contribution!
Co-authored-by: Felix Divo <[email protected]>
Add extra length to other lines in the help text so the border lines up.
Add test coverage for some of the new byte highlighting functions.
Change standard arguments definition to be defined using logger._create_base_argument_parser instead of manually defining them in this module.
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.
Looks good to me!
* Added optional byte highlighting to viewer Added optional byte highlighting that can be toggled using the shortcut key 'h' * Some black formatting changes * Final black formatting * Fixed viewer bug Fix for the following error since the introduction of hardbyte#1151 / hardbyte#1142 Traceback (most recent call last): File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/pi/python-can/can/viewer.py", line 582, in <module> main() File "/home/pi/python-can/can/viewer.py", line 573, in main bus = _create_bus(parsed_args, **additional_config, app_name="python-can viewer") File "/home/pi/python-can/can/logger.py", line 105, in _create_bus if parsed_args.app_name: AttributeError: 'Namespace' object has no attribute 'app_name' * Update scripts.rst update viewer documentations * Update scripts.rst * Update scripts.rst arrange keyboard shortcuts into bulleted list * Update scripts.rst * Update can/viewer.py Co-authored-by: Felix Divo <[email protected]> * Better description. Add extra length to other lines in the help text so the border lines up. * Update test_viewer.py Add test coverage for some of the new byte highlighting functions. * Use _create_base_argument_parser in viewer.py Change standard arguments definition to be defined using logger._create_base_argument_parser instead of manually defining them in this module. Co-authored-by: Felix Divo <[email protected]>
I have been using python-can for message sniffing on a Tractor control bus, and a feature I had seen in some other message viewers was highlighting bytes when their value changes.
I have added this functionality (toggleable - off by default) to viewer.py, and found it useful for what I was trying to achieve so thought I would share it here.
I hope sending a PR like this out of the blue is OK, if not please reject :)