Closed GeoffFroh closed 5 years ago
converters.rolepeople_to_text() currently produces the deprecated "bracket id" format rather than the proper pipe-separated key:value format.
key:value
(from bpython)
>>> import converters >>> rawcreators = "Fred Shiosaki [215]:narrator; Andrea Dilley:interviewer" >>> parsed = converters.text_to_rolepeople(rawcreators) >>> parsed [{'namepart': 'Fred Shiosaki', 'role': 'narrator', 'id': 215}, {'namepart': 'Andrea Dilley', 'role': 'interviewer'}] >>> raw = converters.rolepeople_to_text(parsed) >>> raw 'Fred Shiosaki [215]:narrator; Andrea Dilley:interviewer'
In this case, raw should be:
raw
'namepart:Fred Shiosaki|role:narrator|id:215;namepart:Andrea Dilley|role:interviewer'
Looks like the ROLEPEOPLE_TEXT_TEMPLATE_W_ID template just needs to be replaced at:
ROLEPEOPLE_TEXT_TEMPLATE_W_ID
https://github.com/densho/ddr-cmdln/blob/master/ddr/DDR/converters.py#L787
Fixed in commit a2d31de.
converters.rolepeople_to_text() currently produces the deprecated "bracket id" format rather than the proper pipe-separated
key:value
format.(from bpython)
In this case,
raw
should be:'namepart:Fred Shiosaki|role:narrator|id:215;namepart:Andrea Dilley|role:interviewer'
Looks like the
ROLEPEOPLE_TEXT_TEMPLATE_W_ID
template just needs to be replaced at:https://github.com/densho/ddr-cmdln/blob/master/ddr/DDR/converters.py#L787