+
+ def Scan(self, root='/'):
+ """Scan a device tree, building up a tree of Node objects
+
+ This fills in the self._root property
+
+ Args:
+ root: Ignored
+
+ TODO(sjg@chromium.org): Implement the 'root' parameter
+ """
+ self._root = self.Node(self, 0, '/', '/')
+ self._root.Scan()
+
+ def GetRoot(self):
+ """Get the root Node of the device tree
+
+ Returns:
+ The root Node object
+ """
+ return self._root
+
+ def GetNode(self, path):
+ """Look up a node from its path
+
+ Args:
+ path: Path to look up, e.g. '/microcode/update@0'
+ Returns:
+ Node object, or None if not found
+ """
+ node = self._root
+ for part in path.split('/')[1:]:
+ node = node._FindNode(part)
+ if not node:
+ return None
+ return node
+