#NEWLINE# def setupModelData( self , lines , parent ) : #NEWLINE# #INDENT# parents = [ parent ] #NEWLINE# indentations = [ 0 ] #NEWLINE# number = 0 #NEWLINE# while ( number < len ( lines ) ) : #NEWLINE# #INDENT# position = 0 #NEWLINE# while ( lines < len ( lines [ number ] ) ) : #NEWLINE# #INDENT# if ( lines [ number ] [ position ] != ' ' ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# position += 1 #NEWLINE# #UNINDENT# lineData = lines [ number ] [ position : ] . strip ( ) #NEWLINE# if lineData : #NEWLINE# #INDENT# columnData = [ s for s in lineData . split ( '\t' ) if s ] #NEWLINE# if ( position > indentations [ ( - 1 ) ] ) : #NEWLINE# #INDENT# if ( parents [ ( - 1 ) ] . childCount ( ) > 0 ) : #NEWLINE# #INDENT# parents . append ( parents [ ( - 1 ) ] . child ( ( parents [ ( - 1 ) ] . childCount ( ) - 1 ) ) ) #NEWLINE# indentations . append ( position ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# while ( ( position < indentations [ ( - 1 ) ] ) and ( len ( parents ) > 0 ) ) : #NEWLINE# #INDENT# parents . pop ( ) #NEWLINE# indentations . pop ( ) #NEWLINE# #UNINDENT# #UNINDENT# parent = parents [ ( - 1 ) ] #NEWLINE# parent . insertChildren ( parent . childCount ( ) , 1 , self . rootItem . columnCount ( ) ) #NEWLINE# for column in range ( len ( columnData ) ) : #NEWLINE# #INDENT# parent . child ( ( parent . childCount ( ) - 1 ) ) . setData ( column , columnData [ column ] ) #NEWLINE# #UNINDENT# #UNINDENT# number += 1