giraffez/config.py
def write(self, settings=None):
        """
        Save the current configuration to its file (as given by :code:`self._config_file`).
        Optionally, settings may be passed in to override the current settings before
        writing. Returns :code:`None` if the file could not be written to, either due to
        permissions, or if the :class:`~giraffez.config.Config` object has the :code:`mode`
        'r'.

        :param dict settings: Defaults to :code:`None`, if not :code:`None` this will replace
            `self.settings` prior to writing to the file
        """
        if "r" in self.mode:
            raise ConfigReadOnly("Cannot write Config while in 'r' mode")
        try:
            if settings:
                self.settings = settings
            with open(self._config_file, "w") as f:
                f.write(repr(self))
                return repr(self)
        except OSError:
            return None
def write(self, settings=None):
        """
        Save the current configuration to its file (as given by :code:`self._config_file`).
        Optionally, settings may be passed in to override the current settings before
        writing. Returns :code:`None` if the file could not be written to, either due to
        permissions, or if the :class:`~giraffez.config.Config` object has the :code:`mode`
        'r'.

        :param dict settings: Defaults to :code:`None`, if not :code:`None` this will replace
            `self.settings` prior to writing to the file
        """
        if "r" in self.mode:
            raise ConfigReadOnly("Cannot write Config while in 'r' mode")
        try:
            if settings:
                self.settings = settings
            with open(self._config_file, "w") as f:
                f.write(repr(self))
                return repr(self)
        except OSError:
            return None
Save the current configuration to its file (as given by :code:`self._config_file`).
        Optionally, settings may be passed in to override the current settings before
        writing. Returns :code:`None` if the file could not be written to, either due to
        permissions, or if the :class:`~giraffez.config.Config` object has the :code:`mode`
        'r'.

        :param dict settings: Defaults to :code:`None`, if not :code:`None` this will replace
            `self.settings` prior to writing to the file