Mercurial > pyntnclick
changeset 530:fe51223e0c8d
PEP8 cleanup data.py and endscreen.py
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Sat, 11 Feb 2012 11:58:57 +0200 |
parents | a6f9b6edb6c7 |
children | 60c345d19daf |
files | gamelib/data.py gamelib/endscreen.py |
diffstat | 2 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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) -
--- 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) - -