From 6291cb6686c24bd2131cd36664a4369d98e71558 Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Sun, 24 Apr 2011 10:00:16 -0400 Subject: [PATCH] ocarina: clean up like / dislike button functions these functions are now created as part of the button generating functions --- ocarina/body/button.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/ocarina/body/button.py b/ocarina/body/button.py index 3f900e5d..1ccebf5b 100644 --- a/ocarina/body/button.py +++ b/ocarina/body/button.py @@ -104,19 +104,17 @@ def clear_button(show): def random_button(is_active, show): return make_toggle("images/random.png", controls.set_rand, "Random", is_active, show) -def set_like(like): - if like == False: - like = None - controls.set_like(like) - def like_button(show): + def set_like(like): + if like == False: + like = None + controls.set_like(like) return make_toggle("images/thumbs_up.png", set_like, "I like this", False, show) -def set_dislike(like): - like = not like - if like == True: - like = None - controls.set_like(like) - def dislike_button(show): + def set_dislike(like): + like = not like + if like == True: + like = None + controls.set_like(like) return make_toggle("images/thumbs_down.png", set_dislike, "I don't like this", False, show)