(self)
Move group to subgroup or entry to new group
Move group to subgroup or entry to new group
Move group to subgroup or entry to new group
def move_group_or_entry(self):
        '''Move group to subgroup or entry to new group'''
        
        if (self.state == 3 and 
            self.groups[self.g_highlight] is not self.move_object and
            self.groups):  # e.g. there is actually a group
            if self.remote is True:
                group_id = self.move_object.id_
                root = self.groups[self.g_highlight].id_

                db_buf = self.client().move_group(str(group_id).encode(), 
                                                  str(root).encode())
                if self.check_answer(db_buf) is not False:
                    self.reload_remote_db(db_buf)
            else:
                self.move_object.move_group(self.groups[self.g_highlight])
        elif (self.state == 4 and 
              self.groups[self.g_highlight] is not self.move_object.group and
              self.groups):
            if self.remote is True:
                uuid = self.move_object.uuid
                root = self.groups[self.g_highlight].id_

                db_buf = self.client().move_entry(uuid, 
                                                  str(root).encode())
                if self.check_answer(db_buf) is not False:
                    self.reload_remote_db(db_buf)
            else:
                self.move_object.move_entry(self.groups[self.g_highlight])
        self.changed = True
        self.move_object = None
        self.state = 0
        self.sort_tables(True, True)
def move_group_or_entry ( self ) : if ( self . state == 3 and self . groups [ self . g_highlight ] is not self . move_object and self . groups ) : # e.g. there is actually a group if self . remote is True : group_id = self . move_object . id_ root = self . groups [ self . g_highlight ] . id_ db_buf = self . client ( ) . move_group ( str ( group_id ) . encode ( ) , str ( root ) . encode ( ) ) if self . check_answer ( db_buf ) is not False : self . reload_remote_db ( db_buf ) else : self . move_object . move_group ( self . groups [ self . g_highlight ] ) elif ( self . state == 4 and self . groups [ self . g_highlight ] is not self . move_object . group and self . groups ) : if self . remote is True : uuid = self . move_object . uuid root = self . groups [ self . g_highlight ] . id_ db_buf = self . client ( ) . move_entry ( uuid , str ( root ) . encode ( ) ) if self . check_answer ( db_buf ) is not False : self . reload_remote_db ( db_buf ) else : self . move_object . move_entry ( self . groups [ self . g_highlight ] ) self . changed = True self . move_object = None self . state = 0 self . sort_tables ( True , True )