From 318fe0a9094b2624761d2f6f8de8f491305145bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergiusz=20Baza=C5=84ski?= Date: Sun, 11 Nov 2012 13:25:28 +0100 Subject: [PATCH] Sample view. --- Lasers_und_stuff/main.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Lasers_und_stuff/main.py b/Lasers_und_stuff/main.py index 0b61c0d..4869d96 100644 --- a/Lasers_und_stuff/main.py +++ b/Lasers_und_stuff/main.py @@ -18,6 +18,10 @@ app = flask.Flask(__name__) app.debug = True pygame.init() +@app.route("/") +def root(): + return "COCKS" + def main(): #create the screen window = pygame.display.set_mode((800, 600)) @@ -40,12 +44,13 @@ def main(): gunpoint = Gunpoint((5, 4), (200, 4), (5, 210)) - while True: + keep_running = True + while keep_running: screen.draw_surface(cannon) for event in pygame.event.get(): if event.type == pygame.QUIT: - sys.exit(0) + keep_running = False elif event.type == KEYUP : cannon.send_data() if event.key == K_SPACE: @@ -84,7 +89,8 @@ def main(): elif event.type == MOUSEBUTTONUP: screen.change_color() - + print "Pygame thread exited." + os.kill(os.getpid(), signal.SIGINT)