'Format kwargs before printing them.
Resulting dictionary has to have keys necessary for str.format call
on fmt class variable.'

def _fmt_kwargs(self, **kwargs):

    fmtargs = {}
    for (kw, data) in kwargs.items():
        if isinstance(data, (list, set)):
            fmtargs[kw] = list(map(str, data))
            if (len(fmtargs[kw]) == 1):
                fmtargs[kw] = fmtargs[kw].pop()
        else:
            fmtargs[kw] = data
    return fmtargs
