Method
convert_field
(self, value, conversion)
Source from the content-addressed store, hash-verified
| 265 | |
| 266 | |
| 267 | def convert_field(self, value, conversion): |
| 268 | # do any conversion on the resulting object |
| 269 | if conversion is None: |
| 270 | return value |
| 271 | elif conversion == 's': |
| 272 | return str(value) |
| 273 | elif conversion == 'r': |
| 274 | return repr(value) |
| 275 | elif conversion == 'a': |
| 276 | return ascii(value) |
| 277 | raise ValueError("Unknown conversion specifier {0!s}".format(conversion)) |
| 278 | |
| 279 | |
| 280 | # returns an iterable that contains tuples of the form: |
Tested by
no test coverage detected