# Path: Interface/LayerIntf/layeritem.py
# class LayerItem(object):
#     
#     def __init__(self, data, parent=None):
#         self.parent_item = parent
#         self.item_data = data
#         self.children = []
# 
# 
#     def appendChild(self, item):
#         self.children.append(item)
# 
# 
#     def child(self, row):
#         return self.children[row]
# 
# 
#     def childCount(self):
#         return len(self.children)
# 
# 
#     def columnCount(self):
#         return len(self.item_data)
# 
# 
#     def data(self, column):
#         try:
#             return self.item_data[column]
#         except IndexError:
#             return None
# 
# 
#     def parent(self):
#         return self.parent_item
# 
# 
#     def row(self):
#         if self.parent_item:
#             return self.parent_item.children.index(self)
#         return 0


from PyQt4 import QtCore, QtGui
from Interface.LayerIntf.layeritem import LayerItem

        number = 0

        while number < len(lines):
            position = 0
            while position < len(lines[number]):
                if lines[number][position] != ' ':
                    break
                position += 1

            lineData = lines[number][position:].trimmed()

            if lineData:
                # Read the column data from the rest of the line.
                columnData = [s for s in lineData.split('\t') if s]

                if position > indentations[-1]:
                    # The last child of the current parent is now the new
                    # parent unless the current parent has no children.

                    if parents[-1].childCount() > 0:
                        parents.append(parents[-1].child(parents[-1].childCount() - 1))
                        indentations.append(position)

                else:
                    while position < indentations[-1] and len(parents) > 0:
                        parents.pop()
                        indentations.pop()

                # Append a new item to the current parent's list of children.

# Path: Interface/LayerIntf/layeritem.py
# class LayerItem(object):
#     
#     def __init__(self, data, parent=None):
#         self.parent_item = parent
#         self.item_data = data
#         self.children = []
# 
# 
#     def appendChild(self, item):
#         self.children.append(item)
# 
# 
#     def child(self, row):
#         return self.children[row]
# 
# 
#     def childCount(self):
#         return len(self.children)
# 
# 
#     def columnCount(self):
#         return len(self.item_data)
# 
# 
#     def data(self, column):
#         try:
#             return self.item_data[column]
#         except IndexError:
#             return None
# 
# 
#     def parent(self):
#         return self.parent_item
# 
# 
#     def row(self):
#         if self.parent_item:
#             return self.parent_item.children.index(self)
#         return 0


# Path: Interface/LayerIntf/layermodel.py
from PyQt4 import QtCore, QtGui
from Interface.LayerIntf.layeritem import LayerItem


        number = 0

        while number < len(lines):
            position = 0
            while position < len(lines[number]):
                if lines[number][position] != ' ':
                    break
                position += 1

            lineData = lines[number][position:].trimmed()

            if lineData:
                # Read the column data from the rest of the line.
                columnData = [s for s in lineData.split('\t') if s]

                if position > indentations[-1]:
                    # The last child of the current parent is now the new
                    # parent unless the current parent has no children.

                    if parents[-1].childCount() > 0:
                        parents.append(parents[-1].child(parents[-1].childCount() - 1))
                        indentations.append(position)

                else:
                    while position < indentations[-1] and len(parents) > 0:
                        parents.pop()
                        indentations.pop()

                # Append a new item to the current parent's list of children.

                parents[-1].appendChild(LayerItem(columnData, parents[-1]))