Improve registry docstrings.

This commit is contained in:
Mike Auty
2018-03-11 21:40:54 +00:00
parent 18fa9e74d7
commit dd41ea1cd1
2 changed files with 8 additions and 1 deletions
+5 -1
View File
@@ -99,7 +99,11 @@ class RegistryHive(interfaces.layers.TranslationLayerInterface):
return cell
def get_key(self, key: str, return_list: bool = False) -> interfaces.objects.ObjectInterface:
"""Gets a specific registry key by key path"""
"""Gets a specific registry key by key path
return_list specifies whether the return result will be a single node (default) or a list of nodes from
root to the current node (if return_list is true).
"""
node_key = self.get_node(self.root_cell_offset) if not return_list else [self.get_node(self.root_cell_offset)]
if key.endswith("\\"):
key = key[:-1]
+3
View File
@@ -40,6 +40,9 @@ class PrintKey(plugins.PluginInterface):
def hive_walker(self, hive: RegistryHive, node_path: typing.Sequence[objects.Struct] = None, key_path: str = None) \
-> typing.Generator:
"""Walks through a set of nodes from a given node (last one in node_path).
Avoids loops by not traversing into nodes already present in the node_path
"""
if not node_path:
node_path = [hive.get_node(hive.root_cell_offset)]
if not isinstance(node_path, list) or len(node_path) < 1: