(domain, build_id, xform_version, xform_metadata)
return AppVersionInfo(None, commcare_version, BuildVersionSource.NONE)
there are a bunch of unreliable places to look for a build version
    this abstracts that out
there are a bunch of unreliable places to look for a build version
    this abstracts that out
there are a bunch of unreliable places to look for a build version this abstracts that out
def get_app_version_info(domain, build_id, xform_version, xform_metadata):
    """
    there are a bunch of unreliable places to look for a build version
    this abstracts that out

    """
    appversion_text = get_meta_appversion_text(xform_metadata)
    commcare_version = get_commcare_version_from_appversion_text(appversion_text)
    build_version = get_version_from_build_id(domain, build_id)
    if build_version:
        return AppVersionInfo(build_version, commcare_version, BuildVersionSource.BUILD_ID)

    build_version = get_version_from_appversion_text(appversion_text)
    if build_version:
        return AppVersionInfo(build_version, commcare_version, BuildVersionSource.APPVERSION_TEXT)

    if xform_version and xform_version != '1':
        return AppVersionInfo(int(xform_version), commcare_version, BuildVersionSource.XFORM_VERSION)

    return AppVersionInfo(None, commcare_version, BuildVersionSource.NONE)
def get_app_version_info ( domain , build_id , xform_version , xform_metadata ) : appversion_text = get_meta_appversion_text ( xform_metadata ) commcare_version = get_commcare_version_from_appversion_text ( appversion_text ) build_version = get_version_from_build_id ( domain , build_id ) if build_version : return AppVersionInfo ( build_version , commcare_version , BuildVersionSource . BUILD_ID ) build_version = get_version_from_appversion_text ( appversion_text ) if build_version : return AppVersionInfo ( build_version , commcare_version , BuildVersionSource . APPVERSION_TEXT ) if xform_version and xform_version != '1' : return AppVersionInfo ( int ( xform_version ) , commcare_version , BuildVersionSource . XFORM_VERSION ) return AppVersionInfo ( None , commcare_version , BuildVersionSource . NONE )