Fix display init

pull/1/head
Jake Funke 2017-03-08 21:30:28 +00:00
parent 02476fcaf7
commit c0e943a6df
1 changed files with 8 additions and 6 deletions

View File

@ -6,6 +6,7 @@ class CursedMenu(object):
'''A class which abstracts the horrors of building a curses-based menu system'''
def __init__(self, this_plant):
'''Initialization'''
self.initialized = False
self.screen = curses.initscr()
curses.noecho()
curses.cbreak()
@ -34,9 +35,9 @@ class CursedMenu(object):
self.title = title
self.subtitle = subtitle
self.selected = 0
self.initialized = True
self.draw_menu()
def set_options(self, options):
'''Validates that the last option is "Exit"'''
if options[-1] is not 'Exit':
@ -90,6 +91,7 @@ class CursedMenu(object):
def update_plant_live(self):
# Updates plant data on menu screen, live!
# Will eventually use this to display ascii art...
if self.initialized:
while self.exit is not True:
self.plant_string = self.plant.parse_plant()
self.plant_ticks = str(self.plant.ticks)