Verify a download

def check_download(obj, *args, **kwargs):
    """Verify a download"""
    version = args[0]
    workdir = args[1]
    signame = args[2]
    if version:
        local_version = get_local_version(workdir, signame)
        if not verify_sigfile(workdir, signame) or version != local_version:
            error("[-] \033[91mFailed to verify signature: %s from: %s\033[0m"
                  % (signame, obj.url))
            raise ValueError('Failed to verify signature: %s' % signame)