#NEWLINE# @ classmethod #NEWLINE# def ValidateKey( cls , key_path ) : #NEWLINE# #INDENT# 'Validates this key against supported key names.\n\n    Args:\n      key_path: string containing the path fo the Registry key.\n\n    Raises:\n      FormatError: when key is not supported.\n    ' #NEWLINE# for prefix in prefix . VALID_PREFIXES : #NEWLINE# #INDENT# if key_path . startswith ( prefix ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# #UNINDENT# if key_path . startswith ( 'HKEY_CURRENT_USER\\' ) : #NEWLINE# #INDENT# raise errors . FormatError ( 'HKEY_CURRENT_USER\\ is not supported instead use: HKEY_USERS\\%%users.sid%%\\' ) #NEWLINE# #UNINDENT# raise errors . FormatError ( 'Unupported Registry key path: {0}' . format ( key_path ) )