original_docstring: Parses a Windows Registry file.
  
      Args:
        parser_mediator: A parser mediator object (instance of ParserMediator).
      
docstring: Parses a Windows Registry file.
docstring_tokens: Parses a Windows Registry file .
code: def Parse(self, parser_mediator, **kwargs):
      """Parses a Windows Registry file.
  
      Args:
        parser_mediator: A parser mediator object (instance of ParserMediator).
      """
      display_name = parser_mediator.GetDisplayName()
  
      # TODO: Remove this magic reads when the classifier has been
      # implemented, until then we need to make sure we are dealing with
      # a Windows NT Registry file before proceeding.
  
      if not self._CheckSignature(parser_mediator):
        raise errors.UnableToParseFile((
            u'[{0:s}] unable to parse file: {1:s} with error: invalid '
            u'signature.').format(self.NAME, display_name))
  
      # TODO: refactor this.
      file_entry = parser_mediator.GetFileEntry()
      try:
        winreg_file = self._win_registry.OpenFileEntry(
            file_entry, codepage=parser_mediator.codepage)
      except IOError as exception:
        raise errors.UnableToParseFile(
            u'[{0:s}] unable to parse file: {1:s} with error: {2:s}'.format(
                self.NAME, display_name, exception))
  
      try:
        registry_file_type = self._win_registry.GetRegistryFileType(winreg_file)
        logging.debug(
            u'Windows Registry file {0:s}: detected as: {1:s}'.format(
                display_name, registry_file_type))
  
        self._ParseRegistryFile(parser_mediator, winreg_file, registry_file_type)
  
      finally:
        winreg_file.Close()
code_tokens: def Parse ( self , parser_mediator , ** kwargs ) : display_name = parser_mediator . GetDisplayName ( ) if not self . _CheckSignature ( parser_mediator ) : raise errors . UnableToParseFile ( ( u'[{0:s}] unable to parse file: {1:s} with error: invalid ' u'signature.' ) . format ( self . NAME , display_name ) ) file_entry = parser_mediator . GetFileEntry ( ) try : winreg_file = self . _win_registry . OpenFileEntry ( file_entry , codepage = parser_mediator . codepage ) except IOError as exception : raise errors . UnableToParseFile ( u'[{0:s}] unable to parse file: {1:s} with error: {2:s}' . format ( self . NAME , display_name , exception ) ) try : registry_file_type = self . _win_registry . GetRegistryFileType ( winreg_file ) logging . debug ( u'Windows Registry file {0:s}: detected as: {1:s}' . format ( display_name , registry_file_type ) ) self . _ParseRegistryFile ( parser_mediator , winreg_file , registry_file_type ) finally : winreg_file . Close ( )
short_docstring: Parses a Windows Registry file.
short_docstring_tokens: Parses a Windows Registry file .
comment: """Parses a Windows Registry file.
  
      Args:
        parser_mediator: A parser mediator object (instance of ParserMediator).
      """$SEP$# TODO: Remove this magic reads when the classifier has been$SEP$# implemented, until then we need to make sure we are dealing with$SEP$# a Windows NT Registry file before proceeding.$SEP$# TODO: refactor this.