src/bvhtoolbox/convert/bvh2egg.py
def close_tables(egg_string, target_level=0):
    """ The egg string is hierarchically ordered. This function appends curly brackets to close open tables.
    It takes the indentation of the last closed bracket as reference for the current level/depth of the hierarchy.
    :param egg_string:
    :type egg_string: str
    :param target_level: The level determinates the target indentation/depth,
    in other words how many tables should be closed.
    :type target_level: int
    :return: egg_string with closed tables.
    :rtype: str
    """
    # Get the last level by counting the spaces to the second to last line break.
    last_level = egg_string[egg_string[:-1].rfind("\n"):].count("  ")
    diff = last_level - target_level
    for level in range(diff):
        egg_string += '{0}}}\n'.format('  ' * (last_level - level - 1))
    return egg_string
 The egg string is hierarchically ordered. This function appends curly brackets to close open tables.
    It takes the indentation of the last closed bracket as reference for the current level/depth of the hierarchy.
    :param egg_string:
    :type egg_string: str
    :param target_level: The level determinates the target indentation/depth,
    in other words how many tables should be closed.
    :type target_level: int
    :return: egg_string with closed tables.
    :rtype: str
    
The egg string is hierarchically ordered. This function appends curly brackets to close open tables.
It takes the indentation of the last closed bracket as reference for the current level/depth of the hierarchy.
The egg string is hierarchically ordered . This function appends curly brackets to close open tables . It takes the indentation of the last closed bracket as reference for the current level / depth of the hierarchy .
def close_tables(egg_string, target_level=0):
    last_level = egg_string[egg_string[:-1].rfind("\n"):].count("  ")
    diff = last_level - target_level
    for level in range(diff):
        egg_string += '{0}}}\n'.format('  ' * (last_level - level - 1))
    return egg_string
def close_tables ( egg_string , target_level = 0 ) : last_level = egg_string [ egg_string [ : - 1 ] . rfind ( "\n" ) : ] . count ( "  " ) diff = last_level - target_level for level in range ( diff ) : egg_string += '{0}}}\n' . format ( '  ' * ( last_level - level - 1 ) ) return egg_string
The egg string is hierarchically ordered.
The egg string is hierarchically ordered .
""" The egg string is hierarchically ordered. This function appends curly brackets to close open tables.
    It takes the indentation of the last closed bracket as reference for the current level/depth of the hierarchy.
    :param egg_string:
    :type egg_string: str
    :param target_level: The level determinates the target indentation/depth,
    in other words how many tables should be closed.
    :type target_level: int
    :return: egg_string with closed tables.
    :rtype: str
    """ # Get the last level by counting the spaces to the second to last line break.
egg_string with closed tables.
egg_string with closed tables .
str
egg_string
None
target_level
The level determinates the target indentation/depth,
in other words how many tables should be closed.
The level determinates the target indentation / depth in other words how many tables should be closed .