source/riffle/model.py
def parent(self, index):
        '''Return parent of *index*.'''
        if not index.isValid():
            return QModelIndex()

        item = index.internalPointer()
        if not item:
            return QModelIndex()

        parent = item.parent
        if not parent or parent == self.root:
            return QModelIndex()

        return self.createIndex(parent.row, 0, parent)
def parent(self, index):
        '''Return parent of *index*.'''
        if not index.isValid():
            return QModelIndex()

        item = index.internalPointer()
        if not item:
            return QModelIndex()

        parent = item.parent
        if not parent or parent == self.root:
            return QModelIndex()

        return self.createIndex(parent.row, 0, parent)
def parent ( self , index ) : if not index . isValid ( ) : return QModelIndex ( ) item = index . internalPointer ( ) if not item : return QModelIndex ( ) parent = item . parent if not parent or parent == self . root : return QModelIndex ( ) return self . createIndex ( parent . row , 0 , parent )
Return parent of *index*.
Return parent of * index * .