MCPcopy Index your code
hub / github.com/python/cpython / _move_relative

Method _move_relative

Lib/_pyrepl/windows_console.py:358–370  ·  view source on GitHub ↗

Moves relative to the current posxy

(self, x: int, y: int)

Source from the content-addressed store, hash-verified

356 raise WinError(get_last_error())
357
358 def _move_relative(self, x: int, y: int) -> None:
359 """Moves relative to the current posxy"""
360 dx = x - self.posxy[0]
361 dy = y - self.posxy[1]
362 if dx < 0:
363 self.__write(MOVE_LEFT.format(-dx))
364 elif dx > 0:
365 self.__write(MOVE_RIGHT.format(dx))
366
367 if dy < 0:
368 self.__write(MOVE_UP.format(-dy))
369 elif dy > 0:
370 self.__write(MOVE_DOWN.format(dy))
371
372 def move_cursor(self, x: int, y: int) -> None:
373 if x < 0 or y < 0:

Callers 4

refreshMethod · 0.95
__write_changed_lineMethod · 0.95
move_cursorMethod · 0.95
finishMethod · 0.95

Calls 2

__writeMethod · 0.95
formatMethod · 0.45

Tested by

no test coverage detected