(self, layout)
Apply any config items from our layout
Apply any config items from our layout
Apply any config items from our layout
def create_layout(self, layout):
        """Apply any config items from our layout"""
        if 'children' not in layout:
            err('layout describes no children: %s' % layout)
            return
        children = layout['children']
        if len(children) != 1:
            # We're a Window, we can only have one child
            err('incorrect number of children for Window: %s' % layout)
            return

        child = children[list(children.keys())[0]]
        terminal = self.get_children()[0]
        dbg('Making a child of type: %s' % child['type'])
        if child['type'] == 'VPaned':
            self.split_axis(terminal, True)
        elif child['type'] == 'HPaned':
            self.split_axis(terminal, False)
        elif child['type'] == 'Notebook':
            self.tab_new()
            i = 2
            while i < len(child['children']):
                self.tab_new()
                i = i + 1
        elif child['type'] == 'Terminal':
            pass
        else:
            err('unknown child type: %s' % child['type'])
            return

        self.get_children()[0].create_layout(child)

        if 'last_active_term' in layout and layout['last_active_term'] not in ['', None]:
            self.last_active_term = make_uuid(layout['last_active_term'])

        if 'last_active_window' in layout and layout['last_active_window'] == 'True':
            self.terminator.last_active_window = self.uuid
def create_layout ( self , layout ) : if 'children' not in layout : err ( 'layout describes no children: %s' % layout ) return children = layout [ 'children' ] if len ( children ) != 1 : # We're a Window, we can only have one child err ( 'incorrect number of children for Window: %s' % layout ) return child = children [ list ( children . keys ( ) ) [ 0 ] ] terminal = self . get_children ( ) [ 0 ] dbg ( 'Making a child of type: %s' % child [ 'type' ] ) if child [ 'type' ] == 'VPaned' : self . split_axis ( terminal , True ) elif child [ 'type' ] == 'HPaned' : self . split_axis ( terminal , False ) elif child [ 'type' ] == 'Notebook' : self . tab_new ( ) i = 2 while i < len ( child [ 'children' ] ) : self . tab_new ( ) i = i + 1 elif child [ 'type' ] == 'Terminal' : pass else : err ( 'unknown child type: %s' % child [ 'type' ] ) return self . get_children ( ) [ 0 ] . create_layout ( child ) if 'last_active_term' in layout and layout [ 'last_active_term' ] not in [ '' , None ] : self . last_active_term = make_uuid ( layout [ 'last_active_term' ] ) if 'last_active_window' in layout and layout [ 'last_active_window' ] == 'True' : self . terminator . last_active_window = self . uuid