# HG changeset patch # User Neil Muller # Date 1328954337 -7200 # Node ID fe51223e0c8dec2f9b4e448d949541aed8573117 # Parent a6f9b6edb6c7582fee751329c7bf352467482fde PEP8 cleanup data.py and endscreen.py diff -r a6f9b6edb6c7 -r fe51223e0c8d gamelib/data.py --- a/gamelib/data.py Sat Feb 11 11:57:14 2012 +0200 +++ b/gamelib/data.py Sat Feb 11 11:58:57 2012 +0200 @@ -10,15 +10,16 @@ data_py = os.path.abspath(os.path.dirname(__file__)) data_dir = os.path.normpath(os.path.join(data_py, '..', 'Resources')) + def filepath(filename): '''Determine the path to a file in the data directory. ''' return os.path.join(data_dir, filename) + def load(filename, mode='rb'): '''Open a file in the data directory. "mode" is passed as the second arg to open(). ''' return open(os.path.join(data_dir, filename), mode) - diff -r a6f9b6edb6c7 -r fe51223e0c8d gamelib/endscreen.py --- a/gamelib/endscreen.py Sat Feb 11 11:57:14 2012 +0200 +++ b/gamelib/endscreen.py Sat Feb 11 11:58:57 2012 +0200 @@ -7,6 +7,7 @@ from gamelib.widgets import BoomImageButton + class EndImageButton(BoomImageButton): FOLDER = 'won' @@ -16,8 +17,10 @@ def __init__(self, shell): Screen.__init__(self, shell) self.background = get_image('won', 'won.png') - self._menu_button = EndImageButton('menu.png', 26, 500, action=self.main_menu) - self._quit_button = EndImageButton('quit.png', 250, 500, action=shell.quit) + self._menu_button = EndImageButton('menu.png', 26, 500, + action=self.main_menu) + self._quit_button = EndImageButton('quit.png', 250, 500, + action=shell.quit) self.add(self._menu_button) self.add(self._quit_button) @@ -28,5 +31,3 @@ def main_menu(self): self.shell.show_screen(self.shell.menu_screen) - -