(self)
Edit username of marked entry
Edit username of marked entry
Edit username of marked entry
def edit_username(self):
        '''Edit username of marked entry'''

        if self.entries:
            std = 'Username: '
            edit = Editor(self.control.stdscr, max_text_size=1,
                          inittext=self.entries[self.e_highlight].username,
                          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_user(edit.encode(),
                                                       uuid, last_mod)
                    if self.check_answer(db_buf) is not False:
                        self.reload_remote_db(db_buf)
                else:
                    self.changed = True
                    self.entries[self.e_highlight].set_username(edit)
def edit_username ( self ) : if self . entries : std = 'Username: ' edit = Editor ( self . control . stdscr , max_text_size = 1 , inittext = self . entries [ self . e_highlight ] . username , 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_user ( edit . encode ( ) , uuid , last_mod ) if self . check_answer ( db_buf ) is not False : self . reload_remote_db ( db_buf ) else : self . changed = True self . entries [ self . e_highlight ] . set_username ( edit )