def format_string(self, fmat_string):
        """
        Takes a string containing 0 or more {variables} and formats it
        according to this instance's attributes.

        :param fmat_string: A string, e.g. '{name}-foo.txt'
        :type fmat_string: ``str``

        :return: The string formatted according to this instance. E.g.
                 'production-runtime-foo.txt'
        :rtype: ``str``
        """
        try:
            return fmat_string.format(**vars(self))
        except KeyError as e:
            raise ValueError('Invalid format string: {0}. Instance has no '
                             'attribute {1}.'.format(repr(fmat_string),
                                                     repr(e)))
def format_string(self, fmat_string):
        """
        Takes a string containing 0 or more {variables} and formats it
        according to this instance's attributes.

        :param fmat_string: A string, e.g. '{name}-foo.txt'
        :type fmat_string: ``str``

        :return: The string formatted according to this instance. E.g.
                 'production-runtime-foo.txt'
        :rtype: ``str``
        """
        try:
            return fmat_string.format(**vars(self))
        except KeyError as e:
            raise ValueError('Invalid format string: {0}. Instance has no '
                             'attribute {1}.'.format(repr(fmat_string),
                                                     repr(e)))
def format_string ( self , fmat_string ) : try : return fmat_string . format ( * * vars ( self ) ) except KeyError as e : raise ValueError ( 'Invalid format string: {0}. Instance has no ' 'attribute {1}.' . format ( repr ( fmat_string ) , repr ( e ) ) )
Takes a string containing 0 or more {variables} and formats it
        according to this instance's attributes.

        :param fmat_string: A string, e.g. '{name}-foo.txt'
        :type fmat_string: ``str``

        :return: The string formatted according to this instance. E.g.
                 'production-runtime-foo.txt'
        :rtype: ``str``
Takes a string containing 0 or more { variables } and formats it according to this instance s attributes .