ANSI Filter for ESC 7 and possibly other codes #301
Replies: 6 comments 4 replies
-
👋 hey @denisbondar thanks for raising this! yeah we should handle this better probably :) does the pattern in scrapligo here look better/like it would handle what ya need (and hopefully more)? if "yes" -- would you be up for a PR to make that happen here? thanks a bunch! carl |
Beta Was this translation helpful? Give feedback.
-
In my opinion, the Although, I haven't figured out how to implement multipage data leafing in scrapli for devices where there is no option to disable paginated output, but in this case with leafing the
By the way. As for the regular expression example you gave from the scrapligo project, it is difficult to understand at a quick glance, but if it is time-tested and works as it should, you can use it as a basis. What do you think about the execution of the |
Beta Was this translation helpful? Give feedback.
-
I think you can probably handle this yourself but you're not going to (w/out patching methods at runtime which yay python we can do it :P) be able to do so and use the
I'd be open to seeing an example of this and testing it and seeing whats up, but as I understand it now (which maybe I dont understand it well!) id say there is a very low chance that would be something id merge. |
Beta Was this translation helpful? Give feedback.
-
Tested the regular expression from the scrapligo project for various binary strings from my telnet dumps. Everything worked correctly, including I forked the project and ran the tests first of all. So far I see a lot of failed tests. Tomorrow morning I will sort it out and create a PR. |
Beta Was this translation helpful? Give feedback.
-
Tried to figure out why some tests failed yesterday.
It seems to be incorrect in terms of the idea of unit testing. |
Beta Was this translation helpful? Give feedback.
-
@carlmontanari I created PR #302 based on this discussion. |
Beta Was this translation helpful? Give feedback.
-
Hi, everybody!
I have encountered a ZyXEL MGS3520 device that transmits ANSI ESC 7 (
\e7
) bytes0x1b 0x37
at the end of every response.Each CLI prompt ends in
\e7
, each echo also ends with at least one\e7
, but it can be more if the command takes a long time to execute.I noticed that the filter is designed for a small part of ESC-codes, so I suggest to either supplement it with
0x37
(i.e. just character7
) or to modify it so that it correctly clears all unnecessary ANSI-characters.I saw closed PR #265 that had the ESC E symbol added to it. I suggest discussing adding either one more character 7 or adding all the necessary ESC codes at once. Let's discuss which ESC codes should be removed from
buf
.Example of communication with ZyXEL MGS3520:
Beta Was this translation helpful? Give feedback.
All reactions