(self)
Edit title of group or entry
Edit title of group or entry
Edit title of group or entry
def edit_title(self):
        '''Edit title of group or entry'''

        if self.groups:
            std = 'Title: '
            if self.cur_win == 0:
                edit = Editor(self.control.stdscr, max_text_size=1,
                              inittext=self.groups[self.g_highlight].title,
                              win_location=(0, 1),
                              win_size=(1, self.control.xsize), title=std)()
                if edit == -1:
                    self.close()
                elif edit is not False:
                    if self.remote is True:
                        group_id = self.groups[self.g_highlight].id_
                        last_mod = (self.groups[self.g_highlight]
                                        .last_mod.timetuple())
                        db_buf = self.client().set_g_title(edit.encode(),
                                                           (str(group_id)
                                                            .encode()),
                                                           last_mod)
                        if self.check_answer(db_buf) is not False:
                            self.reload_remote_db(db_buf)
                    else:
                        self.groups[self.g_highlight].set_title(edit)
                        self.changed = True
            elif self.cur_win == 1:
                edit = Editor(self.control.stdscr, max_text_size=1,
                              inittext=self.entries[self.e_highlight].title,
                              win_location=(0, 1),
                              win_size=(1, self.control.xsize), title=std)()
                if edit == -1:
                    self.close()
                elif edit is not False:
                    if self.remote is True:
                        uuid = self.entries[self.e_highlight].uuid
                        last_mod = (self.entries[self.e_highlight]
                                        .last_mod.timetuple())
                        db_buf = self.client().set_e_title(edit.encode(),
                                                           uuid, last_mod)
                        if self.check_answer(db_buf) is not False:
                            self.reload_remote_db(db_buf)
                    else:
                        self.entries[self.e_highlight].set_title(edit)
                        self.changed = True
def edit_title ( self ) : if self . groups : std = 'Title: ' if self . cur_win == 0 : edit = Editor ( self . control . stdscr , max_text_size = 1 , inittext = self . groups [ self . g_highlight ] . title , win_location = ( 0 , 1 ) , win_size = ( 1 , self . control . xsize ) , title = std ) ( ) if edit == - 1 : self . close ( ) elif edit is not False : if self . remote is True : group_id = self . groups [ self . g_highlight ] . id_ last_mod = ( self . groups [ self . g_highlight ] . last_mod . timetuple ( ) ) db_buf = self . client ( ) . set_g_title ( edit . encode ( ) , ( str ( group_id ) . encode ( ) ) , last_mod ) if self . check_answer ( db_buf ) is not False : self . reload_remote_db ( db_buf ) else : self . groups [ self . g_highlight ] . set_title ( edit ) self . changed = True elif self . cur_win == 1 : edit = Editor ( self . control . stdscr , max_text_size = 1 , inittext = self . entries [ self . e_highlight ] . title , win_location = ( 0 , 1 ) , win_size = ( 1 , self . control . xsize ) , title = std ) ( ) if edit == - 1 : self . close ( ) elif edit is not False : if self . remote is True : uuid = self . entries [ self . e_highlight ] . uuid last_mod = ( self . entries [ self . e_highlight ] . last_mod . timetuple ( ) ) db_buf = self . client ( ) . set_e_title ( edit . encode ( ) , uuid , last_mod ) if self . check_answer ( db_buf ) is not False : self . reload_remote_db ( db_buf ) else : self . entries [ self . e_highlight ] . set_title ( edit ) self . changed = True