-
Notifications
You must be signed in to change notification settings - Fork 46
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
extension: add ExtensionPlugin class #116
Conversation
b744cee
to
25be575
Compare
@steweg, what do you want to do with this draft? Shall we close it or do you have questions? |
I will need to rebase it and then I will mark it for review |
e3c2546
to
91b56e5
Compare
Having a plugin that counts calls is fine for non-regression testing. Could we have an example of a meaningful plugin? That would help users to play with this feature. How about contributing to the examples section of the README file for this one? |
91b56e5
to
d7fff81
Compare
I have added another example into tests. Putting the real example is very difficult as it really depends on nature of that extension what you want to achieve. For example in my project we are modifying the parsed structure of given parent node and creating grouping statement on the fly. So I have just put the code that we are using for performing easy checked like whether the extension is only once present on given node and also whether it is put under expected node type. |
23c7b39
to
acf7ee0
Compare
ea55034
to
f8bb900
Compare
@steweg there is this warning when running the test after the last commit of this series, can you check it? |
This patch introduces new class ExtensionPlugin, which is wrapper around libyang extension plugin, which allows user to define custom action for parsing, compiling, and freeing parsed or compiled extensions. Custom actions can also raise a new type of exception LibyangExtensionError, which allows proper translation of exception to libyang error codes and logging of error message Signed-off-by: Stefan Gula <[email protected]>
f8bb900
to
ba76c0e
Compare
Fixed + rebased |
This patch introduces new class ExtensionPlugin, which is wrapper around libyang extension plugin, which allows user to define custom action for parsing, compiling, and freeing parsed or compiled extensions.
Custom actions can also raise a new type of exception LibyangExtensionError, which allows proper translation of exception to libyang error codes and logging of error message