diff gamelib/state.py @ 529:a6f9b6edb6c7

PEP-8 gamescreen and state.
author Jeremy Thurgood <firxen@gmail.com>
date Sat, 11 Feb 2012 11:57:14 +0200
parents 0ce08d5e2acb
children
line wrap: on
line diff
--- a/gamelib/state.py	Fri Sep 10 18:47:17 2010 +0200
+++ b/gamelib/state.py	Sat Feb 11 11:57:14 2012 +0200
@@ -18,10 +18,12 @@
 # whether to show debugging rects
 DEBUG_RECTS = False
 
+
 class Result(object):
     """Result of interacting with a thing"""
 
-    def __init__(self, message=None, soundfile=None, detail_view=None, style=None, close_detail=False, end_game=False):
+    def __init__(self, message=None, soundfile=None, detail_view=None,
+                 style=None, close_detail=False, end_game=False):
         self.message = message
         self.sound = None
         if soundfile:
@@ -39,7 +41,9 @@
             scene_widget.show_message(self.message, self.style)
         if self.detail_view:
             scene_widget.show_detail(self.detail_view)
-        if self.close_detail and hasattr(scene_widget, 'parent') and hasattr(scene_widget.parent, 'clear_detail'):
+        if (self.close_detail
+            and hasattr(scene_widget, 'parent')
+            and hasattr(scene_widget.parent, 'clear_detail')):
             scene_widget.parent.clear_detail()
         if self.end_game:
             scene_widget.end_game()
@@ -283,7 +287,7 @@
         if description is not None:
             w, h = description.size
             sub = screen.get_root().surface.subsurface(
-                Rect(400-w/2, 5, w, h))
+                Rect(400 - w / 2, 5, w, h))
             description.draw_all(sub)
 
     def _cache_background(self):
@@ -383,7 +387,6 @@
         return None
 
 
-
 class Thing(StatefulGizmo, InteractiveMixin):
     """Base class for things in a scene that you can interact with."""