Save the config to the given file or to given default location.

            @param filename: the file to write the config
            @param verbose: If set to true the config file will have all values
                    and all descriptions

def save(self, filename=None, verbose=False):
        ''' Save the config to the given file or to given default location.

            @param filename: the file to write the config
            @param verbose: If set to true the config file will have all values
                    and all descriptions
        '''
        if filename is None:
            if (not self.has_section(self.application_name) or
                    not self.has_option(self.application_name, 'config_file')):
                if not self.has_section(self.application_name):
                    self.add_section(self.application_name)
                if not self.application_name in self.config_description:
                    self.config_description[self.application_name] = {}

                appdir = AppDirs(self.application_name,
                        self.application_author,
                        version=self.application_version)
                value = os.path.join(appdir.user_data_dir, '{0}.conf'.format(
                    self.application_name.lower()))
                if not self.has_option(self.application_name, 'config_file'):
                    self.set(self.application_name, 'config_file', value)
                if not ('config_file' in
                        self.config_description[self.application_name]):
                    self.config_description[self.application_name]\
                            ['config_file'] = ('The config file to '
                                'overwrite on change of the config values. '
                                '[$HOME/.{0}/{0}.conf]'.format(
                                    self.application_name), str, value)

            filename = self.get(self.application_name, 'config_file')

        if not os.path.exists(os.path.dirname(filename)):
            os.makedirs(os.path.dirname(filename))

        hidden = None
        if self.has_section('hidden'):
            hidden = self.items('hidden')
            self.remove_section('hidden')

        cfp = open(filename, 'w')
        self._write_config(cfp, verbose)
        cfp.close()

        if hidden is not None:
            for key, value in hidden:
                self.set('hidden', key, value)