MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / setup_curses

Function setup_curses

examples/space_invaders/space_invaders.py:403–422  ·  view source on GitHub ↗

Setup terminal/curses state.

()

Source from the content-addressed store, hash-verified

401
402
403def setup_curses():
404 """Setup terminal/curses state."""
405
406 window = curses.initscr()
407 curses.noecho()
408
409 window = curses.newwin(
410 WINDOW_HEIGHT + (VERT_PADDING * 2),
411 WINDOW_WIDTH + (HORIZ_PADDING * 2),
412 WINDOW_TOP - VERT_PADDING,
413 WINDOW_LEFT - HORIZ_PADDING,
414 )
415 curses.start_color()
416
417 global _COLOR_PAIRS
418 _COLOR_PAIRS = {}
419 for i, (k, v) in enumerate(COLOR_MAP.items(), 1):
420 curses.init_pair(i, v, curses.COLOR_BLACK)
421 _COLOR_PAIRS[k] = curses.color_pair(i)
422 return window
423
424
425def init_positions(session):

Callers 1

mainFunction · 0.85

Calls 1

itemsMethod · 0.45

Tested by

no test coverage detected