parameters: (self, *args)
docstring: Moves Up the Current Row/Selected Rows
docstring_summary: Moves Up the Current Row/Selected Rows
docstring_tokens: Moves Up the Current Row / Selected Rows
function: def text_row_up(self, *args):
          """Moves Up the Current Row/Selected Rows"""
          text_view, text_buffer, syntax_highl, from_codebox = self.get_text_view_n_buffer_codebox_proof()
          if not text_buffer: return
          if not self.is_curr_node_not_read_only_or_error(): return
          iter_start, iter_end = self.lists_handler.get_paragraph_iters(text_buffer=text_buffer)
          if iter_start == None:
              iter_start = text_buffer.get_iter_at_mark(text_buffer.get_insert())
              iter_end = iter_start.copy()
          last_line_situation = False
          iter_end.forward_char()
          missing_leading_newline = False
          destination_iter = iter_start.copy()
          if not destination_iter.backward_char(): return
          if not destination_iter.backward_char(): missing_leading_newline = True
          else:
              while destination_iter.get_char() != cons.CHAR_NEWLINE:
                  if not destination_iter.backward_char():
                      missing_leading_newline = True
                      break
          if not missing_leading_newline: destination_iter.forward_char()
          destination_offset = destination_iter.get_offset()
          start_offset = iter_start.get_offset()
          end_offset = iter_end.get_offset()
          #print "iter_start %s %s '%s'" % (start_offset, ord(iter_start.get_char()), iter_start.get_char())
          #print "iter_end %s %s '%s'" % (end_offset, ord(iter_end.get_char()), iter_end.get_char())
          #print "destination_iter %s %s '%s'" % (destination_offset, ord(destination_iter.get_char()), destination_iter.get_char())
          text_to_move = text_buffer.get_text(iter_start, iter_end)
          diff_offsets = end_offset - start_offset
          if from_codebox or self.syntax_highlighting != cons.RICH_TEXT_ID:
              text_buffer.delete(iter_start, iter_end)
              destination_iter = text_buffer.get_iter_at_offset(destination_offset)
              if not text_to_move or text_to_move[-1] != cons.CHAR_NEWLINE:
                  diff_offsets += 1
                  text_to_move += cons.CHAR_NEWLINE
              text_buffer.move_mark(text_buffer.get_insert(), destination_iter)
              text_buffer.insert(destination_iter, text_to_move)
              self.set_selection_at_offset_n_delta(destination_offset, diff_offsets-1, text_buffer=text_buffer)
          else:
              rich_text = self.clipboard_handler.rich_text_get_from_text_buffer_selection(text_buffer, iter_start,
  iter_end, exclude_iter_sel_end=True)
              text_buffer.delete(iter_start, iter_end)
              destination_iter = text_buffer.get_iter_at_offset(destination_offset)
              if destination_offset > 0:
                  # clear the newline from any tag
                  clr_start_iter = text_buffer.get_iter_at_offset(destination_offset-1)
                  text_buffer.remove_all_tags(clr_start_iter, destination_iter)
              if not text_to_move or text_to_move[-1] != cons.CHAR_NEWLINE:
                  diff_offsets += 1
                  append_newline = True
              else: append_newline = False
              text_buffer.move_mark(text_buffer.get_insert(), destination_iter)
              # trick of space to prevent subsequent text to take pasted text tag(s)
              text_buffer.insert_at_cursor(cons.CHAR_SPACE)
              destination_iter = text_buffer.get_iter_at_offset(destination_offset)
              text_buffer.move_mark(text_buffer.get_insert(), destination_iter)
              # write moved line
              self.clipboard_handler.from_xml_string_to_buffer(rich_text)
              if append_newline: text_buffer.insert_at_cursor(cons.CHAR_NEWLINE)
              # clear space trick
              cursor_iter = text_buffer.get_iter_at_mark(text_buffer.get_insert())
              text_buffer.delete(cursor_iter, text_buffer.get_iter_at_offset(cursor_iter.get_offset()+1))
              # selection
              self.set_selection_at_offset_n_delta(destination_offset, diff_offsets-1, text_buffer=text_buffer)
          self.state_machine.update_state()
function_tokens: def text_row_up ( self , * args ) : text_view , text_buffer , syntax_highl , from_codebox = self . get_text_view_n_buffer_codebox_proof ( ) if not text_buffer : return if not self . is_curr_node_not_read_only_or_error ( ) : return iter_start , iter_end = self . lists_handler . get_paragraph_iters ( text_buffer = text_buffer ) if iter_start == None : iter_start = text_buffer . get_iter_at_mark ( text_buffer . get_insert ( ) ) iter_end = iter_start . copy ( ) last_line_situation = False iter_end . forward_char ( ) missing_leading_newline = False destination_iter = iter_start . copy ( ) if not destination_iter . backward_char ( ) : return if not destination_iter . backward_char ( ) : missing_leading_newline = True else : while destination_iter . get_char ( ) != cons . CHAR_NEWLINE : if not destination_iter . backward_char ( ) : missing_leading_newline = True break if not missing_leading_newline : destination_iter . forward_char ( ) destination_offset = destination_iter . get_offset ( ) start_offset = iter_start . get_offset ( ) end_offset = iter_end . get_offset ( ) #print "iter_start %s %s '%s'" % (start_offset, ord(iter_start.get_char()), iter_start.get_char()) #print "iter_end %s %s '%s'" % (end_offset, ord(iter_end.get_char()), iter_end.get_char()) #print "destination_iter %s %s '%s'" % (destination_offset, ord(destination_iter.get_char()), destination_iter.get_char()) text_to_move = text_buffer . get_text ( iter_start , iter_end ) diff_offsets = end_offset - start_offset if from_codebox or self . syntax_highlighting != cons . RICH_TEXT_ID : text_buffer . delete ( iter_start , iter_end ) destination_iter = text_buffer . get_iter_at_offset ( destination_offset ) if not text_to_move or text_to_move [ - 1 ] != cons . CHAR_NEWLINE : diff_offsets += 1 text_to_move += cons . CHAR_NEWLINE text_buffer . move_mark ( text_buffer . get_insert ( ) , destination_iter ) text_buffer . insert ( destination_iter , text_to_move ) self . set_selection_at_offset_n_delta ( destination_offset , diff_offsets - 1 , text_buffer = text_buffer ) else : rich_text = self . clipboard_handler . rich_text_get_from_text_buffer_selection ( text_buffer , iter_start , iter_end , exclude_iter_sel_end = True ) text_buffer . delete ( iter_start , iter_end ) destination_iter = text_buffer . get_iter_at_offset ( destination_offset ) if destination_offset > 0 : # clear the newline from any tag clr_start_iter = text_buffer . get_iter_at_offset ( destination_offset - 1 ) text_buffer . remove_all_tags ( clr_start_iter , destination_iter ) if not text_to_move or text_to_move [ - 1 ] != cons . CHAR_NEWLINE : diff_offsets += 1 append_newline = True else : append_newline = False text_buffer . move_mark ( text_buffer . get_insert ( ) , destination_iter ) # trick of space to prevent subsequent text to take pasted text tag(s) text_buffer . insert_at_cursor ( cons . CHAR_SPACE ) destination_iter = text_buffer . get_iter_at_offset ( destination_offset ) text_buffer . move_mark ( text_buffer . get_insert ( ) , destination_iter ) # write moved line self . clipboard_handler . from_xml_string_to_buffer ( rich_text ) if append_newline : text_buffer . insert_at_cursor ( cons . CHAR_NEWLINE ) # clear space trick cursor_iter = text_buffer . get_iter_at_mark ( text_buffer . get_insert ( ) ) text_buffer . delete ( cursor_iter , text_buffer . get_iter_at_offset ( cursor_iter . get_offset ( ) + 1 ) ) # selection self . set_selection_at_offset_n_delta ( destination_offset , diff_offsets - 1 , text_buffer = text_buffer ) self . state_machine . update_state ( )