From 77fc9dff1f161d99a33332a0188bb9cd5b7bc352 Mon Sep 17 00:00:00 2001 From: Brad Bishop Date: Tue, 3 Nov 2015 14:45:07 -0500 Subject: Add ObjectMapper binding Wrapper that allows default parameters to be used with the Mapper DBUS interface. --- OpenBMCMapper.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/OpenBMCMapper.py b/OpenBMCMapper.py index fde385e..3e7a745 100644 --- a/OpenBMCMapper.py +++ b/OpenBMCMapper.py @@ -336,3 +336,19 @@ class PathTree: if not self.root: return {}.iteritems() return PathTreeItemIterator(self, subtree, depth) + +class Mapper: + def __init__(self, bus): + self.bus = bus + obj = bus.get_object(MAPPER_NAME, MAPPER_PATH) + self.iface = dbus.Interface( + obj, dbus_interface = MAPPER_IFACE) + + def get_object(self, path): + return self.iface.GetObject(path) + + def get_subtree_paths(self, path = '/', depth = 0): + return self.iface.GetSubTreePaths(path, depth) + + def get_subtree(self, path = '/', depth = 0): + return self.iface.GetSubTree(path, depth) -- cgit v1.2.3