Exemplo n.º 1
0
Arquivo: ui.py Projeto: Alligator/evo
def update():
    movetolower()
    currentGen = utils.prettyPrint(generation.get(), generation.getScores())
    content.append(urwid.Text(currentGen))
    updateHeaders()
Exemplo n.º 2
0
def newGeneration():
    generation.init()
    print utils.prettyPrint(generation.get(), generation.getScores())
    genMenu()
Exemplo n.º 3
0
Arquivo: ui.py Projeto: Alligator/evo
        ]

text_controls = [
        ('key', ' J'), ('controls', ' - Next Generation\n'),
        ('key', ' R'), ('controls', ' - Start Over\n'),
        '\n',
        ('key', ' M'), ('controls', ' - MIDI Output\n'),
        ('key', ' E'), ('controls', ' - DNA Export\n'),
        '\n',
        ('key', ' Q'), ('controls', ' - Quit')
        ]

midifocus = False
dnafocus = False
generation.init()
currentGen = utils.prettyPrint(generation.get(), generation.getScores())
prevGen = ""

def updateHeaders():
    current = generation.getAge()
    if current == 0:
        prev = 0
    else:
        prev = current-1
    leftheader.set_text([('title', 'Current Generation'), ('title', ' (' + str(current) + ')')])
    leftheader2.set_text([('title', 'Previous Generation'), ('title', ' (' + str(prev) + ')')])

content = [urwid.Text(currentGen)]
leftheader = urwid.Text('')
leftc = urwid.ListBox(content)
edit = urwid.Edit()