carlmontanari / scrapli

Fast, flexible, sync/async, Python 3.7+ screen scraping client specifically for network devices
https://carlmontanari.github.io/scrapli/
MIT License
575 stars 59 forks source link

Update ANSI_ESCAPE_PATTERN for discussion #313 #316

Closed denisbondar closed 8 months ago

denisbondar commented 8 months ago

Description

Modify the ANSI_ESCAPE_PATTERN regular expression so that it honors the control characters described in #313.

Also added comments inside the regular expression to simplify future edits.

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Checklist:

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (e02100d) 90.50% compared to head (a426179) 90.50%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #316 +/- ## ======================================= Coverage 90.50% 90.50% ======================================= Files 60 60 Lines 3487 3487 ======================================= Hits 3156 3156 Misses 331 331 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

carlmontanari commented 8 months ago

👋 just firing up the lab stuff to run against real gear to test too, but think this looks great. I found this and stole from here for some more test cases. this did show one case (the "match clear tabs sequence in a string" one) failing, adding g to the control chars section sorted that.

will try to get the tests ran against real boxes tonight. will holler if anything breaks there, otherwise lemme know if this update/addition looks ok to you and we can get it merged! thanks again for all the help and work @denisbondar !

carlmontanari commented 8 months ago

update: all the tests against container lab boxes worked so, if you're happy we'll get this merged :D

denisbondar commented 8 months ago

Lets go! 🚀