def UpdateVersionFile(self):
    """Updates the version file.

    Returns:
      A boolean indicating the version file was updated.
    """
    version_file_contents = self._ReadVersionFile()
    if not version_file_contents:
      logging.error(u'Unable to read version file.')
      return False

    date_version = time.strftime(u'%Y%m%d')
    project_name = self.GetName()
    lines = version_file_contents.split(u'\n')
    for line_index, line in enumerate(lines):
      if project_name == u'plaso' and line.startswith(u'VERSION_DATE = '):
        version_string = u'VERSION_DATE = \'{0:s}\''.format(date_version)
        lines[line_index] = version_string

      elif project_name != u'plaso' and line.startswith(u'__version__ = '):
        version_string = u'__version__ = \'{0:s}\''.format(date_version)
        lines[line_index] = version_string

    version_file_contents = u'\n'.join(lines)

    try:
      version_file_contents = version_file_contents.encode(u'utf-8')
    except UnicodeEncodeError as exception:
      logging.error(
          u'Unable to write version file with error: {0:s}'.format(exception))
      return False

    try:
      with open(self._version_file_path, u'wb') as file_object:
        file_object.write(version_file_contents)

    except __HOLE__ as exception:
      logging.error(
          u'Unable to write version file with error: {0:s}'.format(exception))
      return False

    return True
dataset/ETHPy150Open log2timeline/dfvfs/utils/review.py/ProjectHelper.UpdateVersionFile