def write(self):
        """
        Rewrite the configuration file. It rewrites the same file than
        PaperworkConfig.read() read.
        """
        logger.info("Updating %s ..." % self.__configfile)

        for setting in self.settings.values():
            setting.update(self._configparser)

        file_path = self.__configfile
        try:
            with open(file_path, 'w') as file_descriptor:
                self._configparser.write(file_descriptor)
            logger.info("Done")
        except IOError as e:
            logger.warn(
                "Cannot write to configuration file %s : %s"
                % (self.__configfile, e.strerror)
            )
            return False

        try:
            # Windows support
            util.hide_file(os.path.expanduser(os.path.join("~", ".config")))
        except Exception as exc:
            logger.warn("Failed to hide configuration file")
            logger.exception(exc)

        return True
def write ( self ) : logger . info ( "Updating %s ..." % self . __configfile ) for setting in self . settings . values ( ) : setting . update ( self . _configparser ) file_path = self . __configfile try : with open ( file_path , 'w' ) as file_descriptor : self . _configparser . write ( file_descriptor ) logger . info ( "Done" ) except IOError as e : logger . warn ( "Cannot write to configuration file %s : %s" % ( self . __configfile , e . strerror ) ) return False try : util . hide_file ( os . path . expanduser ( os . path . join ( "~" , ".config" ) ) ) except Exception as exc : logger . warn ( "Failed to hide configuration file" ) logger . exception ( exc ) return True
Rewrite the configuration file. It rewrites the same file than
        PaperworkConfig.read() read.