summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@us.ibm.com>2015-11-03 14:45:07 -0500
committerBrad Bishop <bradleyb@us.ibm.com>2015-11-03 14:45:07 -0500
commit77fc9dff1f161d99a33332a0188bb9cd5b7bc352 (patch)
tree79bbce62afbc9d03f34705bc721d0c062966cb7e
parentd4a1b93a68964e9550d30436257e4a2540549d20 (diff)
downloadphosphor-objmgr-77fc9dff1f161d99a33332a0188bb9cd5b7bc352.tar.gz
phosphor-objmgr-77fc9dff1f161d99a33332a0188bb9cd5b7bc352.zip
Add ObjectMapper binding
Wrapper that allows default parameters to be used with the Mapper DBUS interface.
-rw-r--r--OpenBMCMapper.py16
1 files changed, 16 insertions, 0 deletions
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)
OpenPOWER on IntegriCloud