diff options
author | Peter Ward <peteraward@gmail.com> | 2012-07-20 00:33:32 +1000 |
---|---|---|
committer | Peter Ward <peteraward@gmail.com> | 2012-07-20 00:33:32 +1000 |
commit | a445e24a2dd88de810ee4dce4e34894377d27c95 (patch) | |
tree | 17a1e16af2794608c03a49e7794b06e0a4a6da3d | |
parent | d8548ba6248f13075e18ece6e3229fe16db6b8a7 (diff) |
Fix curses engine.
-rw-r--r-- | snakegame/engines/curses.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/snakegame/engines/curses.py b/snakegame/engines/curses.py index 1d93c0b..715f321 100644 --- a/snakegame/engines/curses.py +++ b/snakegame/engines/curses.py @@ -1,3 +1,5 @@ +from __future__ import absolute_import + import curses from functools import wraps import time @@ -5,12 +7,6 @@ import time from snakegame import common from snakegame.engines import Engine -def curses_wrapper(fn): - @wraps(fn) - def deco(*args, **kwargs): - return curses.wrapper(fn, *args, **kwargs) - return deco - class CursesEngine(Engine): def new_game(self, *args): super(CursesEngine, self).new_game(*args) @@ -33,7 +29,7 @@ class CursesEngine(Engine): colour = self.EMPTY_COLOUR # Draw the things on the square. - if cell == Squares.APPLE: + if cell == common.APPLE: char = '@' colour = self.APPLE_COLOUR @@ -44,7 +40,6 @@ class CursesEngine(Engine): self.window.addstr(y, x, char, colour) - @curses_wrapper def run(self): while self.bots: # Clear the screen. |