Method
convert_field
(self, value, conversion)
Source from the content-addressed store, hash-verified
| 281 | |
| 282 | |
| 283 | def convert_field(self, value, conversion): |
| 284 | # do any conversion on the resulting object |
| 285 | if conversion is None: |
| 286 | return value |
| 287 | elif conversion == 's': |
| 288 | return str(value) |
| 289 | elif conversion == 'r': |
| 290 | return repr(value) |
| 291 | elif conversion == 'a': |
| 292 | return ascii(value) |
| 293 | raise ValueError("Unknown conversion specifier {0!s}".format(conversion)) |
| 294 | |
| 295 | |
| 296 | # returns an iterable that contains tuples of the form: |
Tested by
no test coverage detected