comparison pytouhou/ui/gamerunner.py @ 224:9bb26dbb8438

Remove useless and occasionally problematic (think about non-utf8 terminals) print calls.
author Thibaut Girka <thib@sitedethib.com>
date Mon, 19 Dec 2011 20:29:30 +0100
parents ee6dfd14a785
children 2d35565b5608
comparison
equal deleted inserted replaced
223:98c64ffcbdff 224:9bb26dbb8438
21 GL_MODELVIEW, GL_PROJECTION, 21 GL_MODELVIEW, GL_PROJECTION,
22 GL_TEXTURE_2D, GL_BLEND, GL_FOG, 22 GL_TEXTURE_2D, GL_BLEND, GL_FOG,
23 GL_PERSPECTIVE_CORRECTION_HINT, GL_FOG_HINT, GL_NICEST, 23 GL_PERSPECTIVE_CORRECTION_HINT, GL_FOG_HINT, GL_NICEST,
24 GL_COLOR_ARRAY, GL_VERTEX_ARRAY, GL_TEXTURE_COORD_ARRAY) 24 GL_COLOR_ARRAY, GL_VERTEX_ARRAY, GL_TEXTURE_COORD_ARRAY)
25 25
26 from pytouhou.utils.helpers import get_logger
27
26 from .gamerenderer import GameRenderer 28 from .gamerenderer import GameRenderer
29
30
31 logger = get_logger(__name__)
27 32
28 33
29 class GameRunner(pyglet.window.Window, GameRenderer): 34 class GameRunner(pyglet.window.Window, GameRenderer):
30 def __init__(self, resource_loader, game=None, background=None, replay=None): 35 def __init__(self, resource_loader, game=None, background=None, replay=None):
31 GameRenderer.__init__(self, resource_loader, game, background) 36 GameRenderer.__init__(self, resource_loader, game, background)
77 # XXX: Ugly workaround to a pyglet bug on X11 82 # XXX: Ugly workaround to a pyglet bug on X11
78 #TODO: fix that bug in pyglet 83 #TODO: fix that bug in pyglet
79 try: 84 try:
80 return pyglet.window.Window._event_text_symbol(self, ev) 85 return pyglet.window.Window._event_text_symbol(self, ev)
81 except Exception as exc: 86 except Exception as exc:
82 print('*WARNING* Pyglet error:') 87 logger.warn('Pyglet error: %s', traceback.format_exc(exc))
83 traceback.print_exc(exc)
84 return None, None 88 return None, None
85 89
86 90
87 def on_key_press(self, symbol, modifiers): 91 def on_key_press(self, symbol, modifiers):
88 if symbol == pyglet.window.key.ESCAPE: 92 if symbol == pyglet.window.key.ESCAPE: