- commit
- 321d3607d0d6e1ee45150258394eab80977a5c77
- parent
- 331d7d6eac5ada18e07759077d6b16a8ff459e65
- Author
- Tobias Bengfort <tobias.bengfort@gmx.net>
- Date
- 2014-05-25 21:10
split run method
Diffstat
| M | DEATH/DeathCliMenu.py | 5 | ++++- |
| M | DEATH/death_ui.py | 6 | +++++- |
2 files changed, 9 insertions, 2 deletions
diff --git a/DEATH/DeathCliMenu.py b/DEATH/DeathCliMenu.py
@@ -40,6 +40,8 @@ class Crs(object): 40 40 curses.start_color() 41 41 curses.init_pair(1, curses.COLOR_BLACK, curses.COLOR_WHITE) 42 42 curses.init_pair(2, curses.COLOR_WHITE, curses.COLOR_BLACK) -1 43 -1 44 def run(self): 43 45 while self.main(): 44 46 pass 45 47 @@ -181,8 +183,9 @@ class Crs(object): 181 183 182 184 if __name__ == '__main__': 183 185 screen = curses.initscr() -1 186 crs = Crs(screen) 184 187 try:185 -1 Crs(screen)-1 188 crs.run() 186 189 except Exception as ex: 187 190 print(ex) 188 191 curses.endwin()
diff --git a/DEATH/death_ui.py b/DEATH/death_ui.py
@@ -46,6 +46,8 @@ class DeathUI(object): 46 46 curses.init_pair(2, curses.COLOR_WHITE, curses.COLOR_BLACK) 47 47 self.row = 0 48 48 self.col = 0 -1 49 -1 50 def run(self): 49 51 self.draw() 50 52 while self.mainloop(): 51 53 winner = self.death.win() @@ -138,8 +140,10 @@ def main(): 138 140 kill.append(abk.conway[2]) 139 141 death = Death(map, n, alive, born, kill, win.economy) 140 142 -1 143 ui = DeathUI(screen, death) -1 144 141 145 try:142 -1 DeathUI(screen, death)-1 146 ui.run() 143 147 except Exception as ex: 144 148 print(ex) 145 149 curses.endwin()