sonar/core/generate.py
def filter_langs(active_langs, sonar_tb_filepath):
    """
    If any of the generated testbenches are newer than the sonar testbench
    script, skip generating it. This probably implies the user has manually
    edited the generated testbench.

    Args:
        active_langs (tuple): Original list of languages to use

    Returns:
        tuple: Filtered list of languages to generate testbenches for
    """
    try:
        sonar_tb_file_time = os.path.getmtime(sonar_tb_filepath)
    except FileNotFoundError:
        # in this case, the testbench is being generated not relative to the
        # source sonar testbench file or there's a typo. Log it and move on
        logger.warning(
            "File %s not found, so not filtering languages by creation time",
            sonar_tb_filepath,
        )
        return active_langs
    active_langs_tmp = []
    for lang in active_langs:
        if os.path.exists(get_tb_filepath(sonar_tb_filepath, lang)):
            tb_time = os.path.getmtime(
                get_tb_filepath(sonar_tb_filepath, lang)
            )
            if tb_time <= sonar_tb_file_time:
                active_langs_tmp.append(lang)
        else:
            active_langs_tmp.append(lang)
    return active_langs_tmp

    If any of the generated testbenches are newer than the sonar testbench
    script, skip generating it. This probably implies the user has manually
    edited the generated testbench.

    Args:
        active_langs (tuple): Original list of languages to use

    Returns:
        tuple: Filtered list of languages to generate testbenches for
    
If any of the generated testbenches are newer than the sonar testbench
script, skip generating it. This probably implies the user has manually
edited the generated testbench.
If any of the generated testbenches are newer than the sonar testbench script skip generating it . This probably implies the user has manually edited the generated testbench .
def filter_langs(active_langs, sonar_tb_filepath):
    try:
        sonar_tb_file_time = os.path.getmtime(sonar_tb_filepath)
    except FileNotFoundError:
        logger.warning(
            "File %s not found, so not filtering languages by creation time",
            sonar_tb_filepath,
        )
        return active_langs
    active_langs_tmp = []
    for lang in active_langs:
        if os.path.exists(get_tb_filepath(sonar_tb_filepath, lang)):
            tb_time = os.path.getmtime(
                get_tb_filepath(sonar_tb_filepath, lang)
            )
            if tb_time <= sonar_tb_file_time:
                active_langs_tmp.append(lang)
        else:
            active_langs_tmp.append(lang)
    return active_langs_tmp
def filter_langs ( active_langs , sonar_tb_filepath ) : try : sonar_tb_file_time = os . path . getmtime ( sonar_tb_filepath ) except FileNotFoundError : logger . warning ( "File %s not found, so not filtering languages by creation time" , sonar_tb_filepath , ) return active_langs active_langs_tmp = [ ] for lang in active_langs : if os . path . exists ( get_tb_filepath ( sonar_tb_filepath , lang ) ) : tb_time = os . path . getmtime ( get_tb_filepath ( sonar_tb_filepath , lang ) ) if tb_time <= sonar_tb_file_time : active_langs_tmp . append ( lang ) else : active_langs_tmp . append ( lang ) return active_langs_tmp
If any of the generated testbenches are newer than the sonar testbench
script, skip generating it.
If any of the generated testbenches are newer than the sonar testbench script skip generating it .
"""
    If any of the generated testbenches are newer than the sonar testbench
    script, skip generating it. This probably implies the user has manually
    edited the generated testbench.

    Args:
        active_langs (tuple): Original list of languages to use

    Returns:
        tuple: Filtered list of languages to generate testbenches for
    """ # in this case, the testbench is being generated not relative to the # source sonar testbench file or there's a typo. Log it and move on
Filtered list of languages to generate testbenches for
Filtered list of languages to generate testbenches for
tuple
active_langs
Original list of languages to use
Original list of languages to use
sonar_tb_filepath