Minor revisions on members of ConsoleDisplay
parent
f1042d351f
commit
4ab82f792b
|
@ -73,7 +73,6 @@ class ConsoleDisplay(_Display):
|
||||||
self.stdscr = curses.initscr()
|
self.stdscr = curses.initscr()
|
||||||
curses.noecho()
|
curses.noecho()
|
||||||
curses.cbreak()
|
curses.cbreak()
|
||||||
stdscr.keypad(True)
|
|
||||||
|
|
||||||
# Specifies the offsets the grid are taken at
|
# Specifies the offsets the grid are taken at
|
||||||
self.x = 0
|
self.x = 0
|
||||||
|
@ -83,8 +82,8 @@ class ConsoleDisplay(_Display):
|
||||||
# reference for future use
|
# reference for future use
|
||||||
width, height = self.cam.master.shape
|
width, height = self.cam.master.shape
|
||||||
self.pad = curses.newpad(width+1, height+1)
|
self.pad = curses.newpad(width+1, height+1)
|
||||||
self.pad.nodelay(1)
|
self.pad.nodelay(True)
|
||||||
self.pad.keypad(1)
|
self.pad.keypad(True)
|
||||||
|
|
||||||
# Construct the necessary planes
|
# Construct the necessary planes
|
||||||
self.panels = []
|
self.panels = []
|
||||||
|
@ -139,13 +138,13 @@ class ConsoleDisplay(_Display):
|
||||||
# Draw out to console
|
# Draw out to console
|
||||||
line = 0
|
line = 0
|
||||||
for bits in grid.flat:
|
for bits in grid.flat:
|
||||||
pad.move(line, 0)
|
self.pad.move(line, 0)
|
||||||
pad.addstr((bits[x:] + bits[:x]).to01())
|
self.pad.addstr((bits[x:] + bits[:x]).to01())
|
||||||
line += 1
|
line += 1
|
||||||
|
|
||||||
# Draw out to screen
|
# Draw out to screen
|
||||||
curses.panels.update_panels()
|
curses.panels.update_panels()
|
||||||
pad.refresh(0, 0, 0, 0, max_y-1, max_x-1)
|
self.pad.refresh(0, 0, 0, 0, max_y-1, max_x-1)
|
||||||
|
|
||||||
# Prepare for next loop
|
# Prepare for next loop
|
||||||
time.sleep(self.clock / 1000)
|
time.sleep(self.clock / 1000)
|
||||||
|
@ -153,7 +152,7 @@ class ConsoleDisplay(_Display):
|
||||||
|
|
||||||
except:
|
except:
|
||||||
curses.nocbreak()
|
curses.nocbreak()
|
||||||
stdscr.keypad(False)
|
self.pad.keypad(False)
|
||||||
curses.echo()
|
curses.echo()
|
||||||
curses.endwin()
|
curses.endwin()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue