src/bvhtoolbox/convert/csv2bvh.py
def _close_scopes(hierarchy_string, target_depth=0):
    """ The string is hierarchically ordered. This function appends curly brackets to close open scopes.
    It takes the indentation of the last closed bracket as reference for the current level/depth of the hierarchy.
    :param hierarchy_string:
    :type hierarchy_string: str
    :param target_depth: The depth determines the target indentation.
    :type target_depth: int
    :return: string with closed scopes.
    :rtype: str
    """
    # Get the last level by counting the spaces to the second to last line break.
    last_depth = hierarchy_string[hierarchy_string[:-1].rfind("\n"):].count("  ")
    diff = last_depth - target_depth
    for depth in range(diff):
        hierarchy_string += '{0}}}\n'.format('  ' * (last_depth - depth - 1))
    return hierarchy_string
 The string is hierarchically ordered. This function appends curly brackets to close open scopes.
    It takes the indentation of the last closed bracket as reference for the current level/depth of the hierarchy.
    :param hierarchy_string:
    :type hierarchy_string: str
    :param target_depth: The depth determines the target indentation.
    :type target_depth: int
    :return: string with closed scopes.
    :rtype: str
    
The string is hierarchically ordered. This function appends curly brackets to close open scopes.
It takes the indentation of the last closed bracket as reference for the current level/depth of the hierarchy.
The string is hierarchically ordered . This function appends curly brackets to close open scopes . It takes the indentation of the last closed bracket as reference for the current level / depth of the hierarchy .
def _close_scopes(hierarchy_string, target_depth=0):
    last_depth = hierarchy_string[hierarchy_string[:-1].rfind("\n"):].count("  ")
    diff = last_depth - target_depth
    for depth in range(diff):
        hierarchy_string += '{0}}}\n'.format('  ' * (last_depth - depth - 1))
    return hierarchy_string
def _close_scopes ( hierarchy_string , target_depth = 0 ) : last_depth = hierarchy_string [ hierarchy_string [ : - 1 ] . rfind ( "\n" ) : ] . count ( "  " ) diff = last_depth - target_depth for depth in range ( diff ) : hierarchy_string += '{0}}}\n' . format ( '  ' * ( last_depth - depth - 1 ) ) return hierarchy_string
The string is hierarchically ordered.
The string is hierarchically ordered .
""" The string is hierarchically ordered. This function appends curly brackets to close open scopes.
    It takes the indentation of the last closed bracket as reference for the current level/depth of the hierarchy.
    :param hierarchy_string:
    :type hierarchy_string: str
    :param target_depth: The depth determines the target indentation.
    :type target_depth: int
    :return: string with closed scopes.
    :rtype: str
    """ # Get the last level by counting the spaces to the second to last line break.
string with closed scopes.
string with closed scopes .
str
hierarchy_string
None
target_depth
The depth determines the target indentation.
The depth determines the target indentation .