diff options
| author | Patrick Williams <patrick@stwcx.xyz> | 2016-10-09 16:14:51 -0500 |
|---|---|---|
| committer | Patrick Williams <patrick@stwcx.xyz> | 2016-10-12 16:26:46 -0500 |
| commit | 1695cdf6b34d8eb080505c7ac45c253475efe3f1 (patch) | |
| tree | e5186e38c3c2bc51371b12323d5c32da8f574206 | |
| parent | f79f358f9f37f0a4ec5814e35ffe1297a32505ed (diff) | |
| download | sdbusplus-1695cdf6b34d8eb080505c7ac45c253475efe3f1.tar.gz sdbusplus-1695cdf6b34d8eb080505c7ac45c253475efe3f1.zip | |
method: parse YAML content
Change-Id: Icf80254fe5f8271c0e32cd7e49c910080b7451c3
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
| -rw-r--r-- | tools/sdbusplus/interface.py | 3 | ||||
| -rw-r--r-- | tools/sdbusplus/method.py | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tools/sdbusplus/interface.py b/tools/sdbusplus/interface.py index 9b55001..d260f92 100644 --- a/tools/sdbusplus/interface.py +++ b/tools/sdbusplus/interface.py @@ -2,6 +2,7 @@ import os import yaml from .namedelement import NamedElement from .property import Property +from .method import Method class Interface(NamedElement, object): @staticmethod @@ -18,5 +19,7 @@ class Interface(NamedElement, object): def __init__(self, **kwargs): self.properties = [ Property(**p) for p in kwargs.pop('properties', []) ] + self.methods = [ Method(**m) for m in + kwargs.pop('methods', []) ] super(Interface, self).__init__(**kwargs) diff --git a/tools/sdbusplus/method.py b/tools/sdbusplus/method.py new file mode 100644 index 0000000..d7635e1 --- /dev/null +++ b/tools/sdbusplus/method.py @@ -0,0 +1,12 @@ +from .property import Property +from .namedelement import NamedElement + +class Method(NamedElement): + def __init__(self, **kwargs): + self.parameters = [ Property(**p) for p in + kwargs.pop('parameters', []) ] + self.returns = [ Property(**r) for r in + kwargs.pop('returns', []) ] + self.errors = kwargs.pop('errors', []) + + super(Method, self).__init__(**kwargs) |

