def _cli_check_ref_format(fmt):
    '''Checks that a reference format exists and if not, raises a helpful exception'''

    if fmt is None:
        return None

    fmt = fmt.lower()
    if not fmt in api.get_reference_formats():
        errstr = "Reference format '" + fmt + "' does not exist.\n"
        errstr += "For a complete list of formats, use the 'bse list-ref-formats' command"
        raise RuntimeError(errstr)

    return fmt
def _cli_check_ref_format ( fmt ) : if fmt is None : return None fmt = fmt . lower ( ) if not fmt in api . get_reference_formats ( ) : errstr = "Reference format '" + fmt + "' does not exist.\n" errstr += "For a complete list of formats, use the 'bse list-ref-formats' command" raise RuntimeError ( errstr ) return fmt
Checks that a reference format exists and if not, raises a helpful exception