qas_editor/gui/exams.py
def moveCursor(self, dx, dy):
        """
        Move the cursor. While NOT in edit mode it will skip black squares (None's).
        """
        x, y = self.cursor()
        if self.editMode() or not self.restrictedCursor():
            x += dx
            y += dy
            if x < 0:
                x = self.puzzleWidth() - 1
            elif x >= self.puzzleWidth():
                x = 0
            if y < 0:
                y = self.puzzleHeight() - 1
            elif y >= self.puzzleHeight():
                y = 0
            self.setCursor(x, y)
        else:
            safe = self.puzzleWidth() + self.puzzleHeight()
            while safe > 0:
                x += dx
                y += dy
                if x > self.puzzleWidth() - 1:
                    x = 0
                elif x < 0:
                    x = self.puzzleWidth() - 1
                if y > self.puzzleHeight() - 1:
                    y = 0
                elif y < 0:
                    y = self.puzzleHeight() - 1
                if not self.char(x, y) is None:
                    break
                safe -= 1
            self.setCursor(x, y)

        Move the cursor. While NOT in edit mode it will skip black squares (None's).
        
Move the cursor. While NOT in edit mode it will skip black squares (None's).
Move the cursor . While NOT in edit mode it will skip black squares ( None ' s ) .
def moveCursor(self, dx, dy):
        x, y = self.cursor()
        if self.editMode() or not self.restrictedCursor():
            x += dx
            y += dy
            if x < 0:
                x = self.puzzleWidth() - 1
            elif x >= self.puzzleWidth():
                x = 0
            if y < 0:
                y = self.puzzleHeight() - 1
            elif y >= self.puzzleHeight():
                y = 0
            self.setCursor(x, y)
        else:
            safe = self.puzzleWidth() + self.puzzleHeight()
            while safe > 0:
                x += dx
                y += dy
                if x > self.puzzleWidth() - 1:
                    x = 0
                elif x < 0:
                    x = self.puzzleWidth() - 1
                if y > self.puzzleHeight() - 1:
                    y = 0
                elif y < 0:
                    y = self.puzzleHeight() - 1
                if not self.char(x, y) is None:
                    break
                safe -= 1
            self.setCursor(x, y)
def moveCursor ( self , dx , dy ) : x , y = self . cursor ( ) if self . editMode ( ) or not self . restrictedCursor ( ) : x += dx y += dy if x < 0 : x = self . puzzleWidth ( ) - 1 elif x >= self . puzzleWidth ( ) : x = 0 if y < 0 : y = self . puzzleHeight ( ) - 1 elif y >= self . puzzleHeight ( ) : y = 0 self . setCursor ( x , y ) else : safe = self . puzzleWidth ( ) + self . puzzleHeight ( ) while safe > 0 : x += dx y += dy if x > self . puzzleWidth ( ) - 1 : x = 0 elif x < 0 : x = self . puzzleWidth ( ) - 1 if y > self . puzzleHeight ( ) - 1 : y = 0 elif y < 0 : y = self . puzzleHeight ( ) - 1 if not self . char ( x , y ) is None : break safe -= 1 self . setCursor ( x , y )
Move the cursor.
Move the cursor .
"""
        Move the cursor. While NOT in edit mode it will skip black squares (None's).
        """
self
dx
dy