'Run external `prog` on file path associated with `item`, cache
output as flexattr on a key that is the name of the program, and
return the key, checksum tuple.'

def _checksum(self, item, prog):

    args = [p.format(file=item.path) for p in shlex.split(prog)]
    key = args[0]
    checksum = getattr(item, key, False)
    if (not checksum):
        self._log.debug(u'key    {0}    on    item    {1}    not    cached:computing    checksum', key, displayable_path(item.path))
        try:
            checksum = command_output(args)
            setattr(item, key, checksum)
            item.store()
            self._log.debug(u'computed    checksum    for    {0}    using    {1}', item.title, key)
        except subprocess.CalledProcessError as e:
            self._log.debug(u'failed    to    checksum    {0}:    {1}', displayable_path(item.path), e)
    else:
        self._log.debug(u'key    {0}    on    item    {1}    cached:not    computing    checksum', key, displayable_path(item.path))
    return (key, checksum)
