Ejemplo n.º 1
0
 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
Ejemplo n.º 2
0
 def _format(self, value, opts):
     assert isinstance(value, unicode)
     return quote(value) if opts.get('quote') else value
Ejemplo n.º 3
0
 def _format(self, value, opts):
     assert isinstance(value, str)
     s = value.decode(self.encoding)
     return quote(s) if opts.get('quote') else s
 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