def _GetKeyFromRegistry(self):
if not self._registry:<EOL><INDENT>return<EOL><DEDENT>try:<EOL><INDENT>self._registry_key = self._registry.GetKeyByPath(self._key_path)<EOL><DEDENT>except RuntimeError:<EOL><INDENT>pass<EOL><DEDENT>if not self._registry_key:<EOL><INDENT>return<EOL><DEDENT>for sub_registry_key in self._registry_key.GetSubkeys():<EOL><INDENT>self.AddSubkey(sub_registry_key)<EOL><DEDENT>if self._key_path == '<STR_LIT>':<EOL><INDENT>sub_registry_key = VirtualWinRegistryKey(<EOL>'<STR_LIT>', registry=self._registry)<EOL>self.AddSubkey(sub_registry_key)<EOL><DEDENT>self._registry = None<EOL>
Determines the key from the Windows Registry.