generic/py-backend/fs_utils/list_dir.py
def _extract_file_info(directory, root_path, name):
    """Returns file description required for QML FileList component.

    Keyword arguments:
    directory -- file directory
    root_path -- current root directory (to estimate nested level)
    name -- file name
    """
    file_path = join(directory, name)
    rel_path = relpath(file_path, root_path)
    return {
        "name": name,
        "path": file_path,
        "dir_name": dirname(file_path),
        "is_file": isfile(file_path),
        "is_dir": isdir(file_path),
        "level": len(rel_path.split('/')) - 1
    }
Returns file description required for QML FileList component.

    Keyword arguments:
    directory -- file directory
    root_path -- current root directory (to estimate nested level)
    name -- file name
    
Returns file description required for QML FileList component.
Returns file description required for QML FileList component .
def _extract_file_info(directory, root_path, name):
    file_path = join(directory, name)
    rel_path = relpath(file_path, root_path)
    return {
        "name": name,
        "path": file_path,
        "dir_name": dirname(file_path),
        "is_file": isfile(file_path),
        "is_dir": isdir(file_path),
        "level": len(rel_path.split('/')) - 1
    }
def _extract_file_info ( directory , root_path , name ) : file_path = join ( directory , name ) rel_path = relpath ( file_path , root_path ) return { "name" : name , "path" : file_path , "dir_name" : dirname ( file_path ) , "is_file" : isfile ( file_path ) , "is_dir" : isdir ( file_path ) , "level" : len ( rel_path . split ( '/' ) ) - 1 }
Returns file description required for QML FileList component.
Returns file description required for QML FileList component .
"""Returns file description required for QML FileList component.

    Keyword arguments:
    directory -- file directory
    root_path -- current root directory (to estimate nested level)
    name -- file name
    """
directory
root_path
name