def __format__(self, format_spec):
        """Handle format(xkb, format_spec) as xkb.format(format_spec) if
        format_spec is not empty. Otherwise just return str(self).

        :param format_spec: format specifier
        :rtype: str
        """
        if len(format_spec) > 0:
            return self.format(format_spec)
        return str(self)
def __format__ ( self , format_spec ) : if len ( format_spec ) > 0 : return self . format ( format_spec ) return str ( self )
Handle format(xkb, format_spec) as xkb.format(format_spec) if
        format_spec is not empty. Otherwise just return str(self).

        :param format_spec: format specifier
        :rtype: str