Commits

Devin Jeanpierre committed 415490d Draft

Oops, forgot to change hasattr check

  • Participants
  • Parent commits 8362cdf

Comments (0)

Files changed (2)

File examples/pygame_integration.py

         resolution, FONT_SIZE, resolution_in_pixels, False)
 
     surface = pygame.Surface(resolution)
-    return surface, pygame_display.PartialScreen(
+    return pygame_display.PartialScreen(
         surface, CON_FONT, CON_BOLD_FONT, FONT_SIZE)
 
 class Window(object):
         self.frame = urwid.Frame(self.buffer_list)
         self.title_label = urwid.Text(title, wrap='clip')
         self.deactivate()
-        self.surface, screen = new_window_screen((40, 10))
+        screen = new_window_screen((40, 10))
         self.loop = urwid.MainLoop(
             self.frame,
             PALETTE,
             unhandled_input=self.update_from_keyboard,
             screen=screen)
+        self.surface = screen.surface
         self.rect = self.surface.get_rect()
 
     def update_from_keyboard(self, key):

File pygame_display.py

         """
         
         super(BaseSurfaceScreen, self).start()
-        assert hasattr(self, '_surface')
+        assert hasattr(self, 'surface')
 
     
     def stop(self):
         if self._cursor_position is not None:
             self._grid_dirty.add(self._cursor_position)
         
-        self._refresh(self._grid_dirty)
+        dirtied = self._refresh(self._grid_dirty)
         self._grid_dirty.clear()
+        return dirtied
 
     def _refresh(self, tiles):
         cell_w = self._cell_width