(self)
Create a sub group with marked group as parent
Create a sub group with marked group as parent
Create a sub group with marked group as parent
def create_sub_group(self):
        '''Create a sub group with marked group as parent'''

        if self.groups:
            edit = Editor(self.control.stdscr, max_text_size=1,
                          win_location=(0, 1),
                          win_size=(1, 80), title="Group Name: ")()
            if edit == -1:
                self.close()
            elif edit is not False:
                if self.remote is True:
                    root = self.groups[self.g_highlight].id_
                    db_buf = self.client().create_group(edit.encode(),
                                                        (str(root)
                                                         .encode()))
                    if self.check_answer(db_buf) is not False:
                        self.reload_remote_db(db_buf)
                else:
                    try:
                        self.db.create_group(edit, 
                                             self.groups[self.g_highlight])
                    except KPError as err:
                        self.control.draw_text(self.changed,
                                               (1, 0, err.__str__()),
                                               (4, 0, 'Press any key.'))
                        if self.control.any_key() == -1:
                            self.close()
                    else:
                        self.changed = True
def create_sub_group ( self ) : if self . groups : edit = Editor ( self . control . stdscr , max_text_size = 1 , win_location = ( 0 , 1 ) , win_size = ( 1 , 80 ) , title = "Group Name: " ) ( ) if edit == - 1 : self . close ( ) elif edit is not False : if self . remote is True : root = self . groups [ self . g_highlight ] . id_ db_buf = self . client ( ) . create_group ( edit . encode ( ) , ( str ( root ) . encode ( ) ) ) if self . check_answer ( db_buf ) is not False : self . reload_remote_db ( db_buf ) else : try : self . db . create_group ( edit , self . groups [ self . g_highlight ] ) except KPError as err : self . control . draw_text ( self . changed , ( 1 , 0 , err . __str__ ( ) ) , ( 4 , 0 , 'Press any key.' ) ) if self . control . any_key ( ) == - 1 : self . close ( ) else : self . changed = True