Method
convert_field
(self, value, conversion)
Source from the content-addressed store, hash-verified
| 275 | return format(value, format_spec) |
| 276 | |
| 277 | def convert_field(self, value, conversion): |
| 278 | # do any conversion on the resulting object |
| 279 | if conversion is None: |
| 280 | return value |
| 281 | elif conversion == 's': |
| 282 | return str(value) |
| 283 | elif conversion == 'r': |
| 284 | return repr(value) |
| 285 | elif conversion == 'a': |
| 286 | return ascii(value) |
| 287 | raise ValueError("Unknown conversion specifier {0!s}".format(conversion)) |
| 288 | |
| 289 | def parse(self, format_string): |
| 290 | """ |
Tested by
no test coverage detected