-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Help with indentation in templates #22
Comments
Probably you now invoking ttp parser object properly, this works for me using
|
I had tried the above method earlier and it works. However, lets say I create the template inside a python function, where it will automatically be indented, like so:
This is adding extra whitespaces due to the indentation and it breaks the template parsing. For one line templates, I can declare them inline and escape this problem. But for bigger templates, it is challenges and makes readability of the template difficult. |
Have a look at tests on how to define templates within functions using triple quotes: ttp/test/pytest/test_anonymous_group.py Line 28 in 8e67084
|
Thank you, this works perfectly. |
Hi,
I have the following data I want to parse through, to simply extract the IP address of the interface.
With the assumption that my template will be indented in python code, I have added numerous whitespaces in the template and want to regex match on it to ignore the white spaces. The template I have is:
This is unable to parse through the data and I always get an empty list back. Any idea what I am doing wrong here?
The text was updated successfully, but these errors were encountered: