diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 3 | ||||
-rwxr-xr-x | src/pdmgen.py | 16 | ||||
-rw-r--r-- | src/templates/generated.mako.hpp | 1 | ||||
-rw-r--r-- | src/templates/resolve_errors.mako.cpp | 1 |
4 files changed, 20 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 29a4ba7..c20b9dd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -31,7 +31,8 @@ TEMPLATES = \ templates/journal.mako.cpp \ templates/elog.mako.cpp \ templates/errors.mako.hpp \ - templates/method.mako.cpp + templates/method.mako.cpp \ + templates/resolve_errors.mako.cpp generated.hpp: $(PDMGEN) $(YAML_PATH) $(TEMPLATES) $(AM_V_GEN)$(PYTHON) ${PDMGEN} \ diff --git a/src/pdmgen.py b/src/pdmgen.py index 693b149..9ed27cd 100755 --- a/src/pdmgen.py +++ b/src/pdmgen.py @@ -699,6 +699,21 @@ class Elog(Callback, Renderer): indent=indent) +class ResolveCallout(Callback, Renderer): + '''Handle the 'resolve callout' callback config file directive.''' + + def __init__(self, *a, **kw): + self.callout = kw.pop('callout') + super(ResolveCallout, self).__init__(**kw) + + def construct(self, loader, indent): + return self.render( + loader, + 'resolve_errors.mako.cpp', + c=self, + indent=indent) + + class Method(ConfigEntry, Renderer): '''Handle the method callback config file directive.''' @@ -869,6 +884,7 @@ class Everything(Renderer): 'elog': Elog, 'group': GroupOfCallbacks, 'method': Method, + 'resolve callout': ResolveCallout, }, 'condition': { 'count': CountCondition, diff --git a/src/templates/generated.mako.hpp b/src/templates/generated.mako.hpp index 04f2bde..740acfa 100644 --- a/src/templates/generated.mako.hpp +++ b/src/templates/generated.mako.hpp @@ -12,6 +12,7 @@ #include "errors.hpp" #include "method.hpp" #include "propertywatchimpl.hpp" +#include "resolve_errors.hpp" #include "sdbusplus.hpp" #include "sdevent.hpp" diff --git a/src/templates/resolve_errors.mako.cpp b/src/templates/resolve_errors.mako.cpp new file mode 100644 index 0000000..8b49031 --- /dev/null +++ b/src/templates/resolve_errors.mako.cpp @@ -0,0 +1 @@ +std::make_unique<ResolveCallout>("${c.callout}")\ |