def _format(self, data, opts): assert isinstance(data, dict) delimiter = self.delimiter f = lambda t: unicode(t[0]) + ': ' + quote(t[1]) s = delimiter.join(map(f, data.iteritems())) return u'{%s}' % s if opts.get('quote') else s
def _format(self, value, opts): assert isinstance(value, unicode) return quote(value) if opts.get('quote') else value
def _format(self, value, opts): assert isinstance(value, str) s = value.decode(self.encoding) return quote(s) if opts.get('quote') else s