'Saves the profile to file_name.
:return: None'

def save(self, file_name=''):

    if (not self.profile_file_name):
        if (not file_name):
            raise BaseFrameworkException('Error    saving    profile,    profile    file    name    is    required.')
        elif (not file_name.endswith(self.EXTENSION)):
            file_name += self.EXTENSION
        if (os.path.sep not in file_name):
            file_name = os.path.join(get_home_dir(), 'profiles', file_name)
        self.profile_file_name = file_name
    try:
        file_handler = open(self.profile_file_name, 'w')
    except:
        msg = 'Failed    to    open    profile    file:    "%s"'
        raise BaseFrameworkException((msg % self.profile_file_name))
    else:
        self._config.write(file_handler)
