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

fix read_callback only_once logic #354

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

realvitya
Copy link
Contributor

Description

The logic missed the point that if a ReadCallback does NOT match, then it shouldn't logged as an already matched case.
The fix does not interfere the behavior except now it doesn't log unnecessarily for non-matched cases.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Re-wrote the relevant test case. This part was more cumbersome than the fix :)

Checklist:

  • My code follows the style guidelines of this project (no GitHub actions complaints! run make lint before
    committing!)
  • I have commented my code, pydocstyle and darglint are happy, docstrings are in google docstring format, and all
    docstrings include a summary, args, returns and raises fields (even if N/A)
  • I have added tests that prove my fix is effective or that my feature works, if adding "functional" tests please
    note if there are any considerations for the vrnetlab setup
  • New and existing unit tests pass locally with my changes

@carlmontanari
Copy link
Owner

glad to see someone using the read callback thing :D looks like the linter complaint is totally unrelated... ill figure that out later. LGTM, thanks as always and thanks for tests!! you're the best!

@carlmontanari carlmontanari merged commit 1513274 into carlmontanari:main Oct 15, 2024
7 of 12 checks passed
@realvitya
Copy link
Contributor Author

This is a cool feature I found recently. I use it for upgrade process where the box asks stupid questions and I can act accordingly. But the coolest thing is that I can use it to advance the rich.progressbar as device emits ## chars to indicate file upload. Then I can show it to the user with fancy rich way.

@carlmontanari
Copy link
Owner

ahhhh very nice! makes sense -- yeah I created it in scrapligo first for boxen (rip that project lol) for handling initial startup config and stuff like that, so pretty similar process... its probably why there are some mess ups in the python one (crappily ported over :)). thanks a bunch for fixing them for us all! :D

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.

2 participants