Permalink
Browse files

Moving the Flask stuff into Avenue for (theoretically) seamless integ…

…ration.
  • Loading branch information...
Aethaeryn committed Apr 26, 2012
1 parent 606c294 commit 25701d2d76beb99982222408f404a015e6a0e586
Showing with 7 additions and 15 deletions.
  1. +5 −13 federation/__init__.py
  2. +2 −2 federation/public.py
View
@@ -9,23 +9,15 @@
serves http pages that can be accessed directly by a modern browser
with JavaScript and canvas support.
'''
-from flask import Flask
+from federation import public, game
-app = Flask(__name__)
-
-from federation import game, public
-
-game.start()
-
-def set_up():
- website = [['/' , 'index', public.index],
+class Federation():
+ website = [['/' , 'game_index', public.game_index],
['/data/' , 'data', public.data_folder],
['/data/environment' , 'environment', public.environment],
['/data/player/' , 'players', public.players],
['/data/player/<username>' , 'player', public.player],
['/data/secret' , 'secret', public.secret]]
- for page in website:
- app.add_url_rule(*page)
-
-set_up()
+ def __init__(self):
+ game.start()
View
@@ -5,7 +5,7 @@
for dynamic rendering of the content.
'''
from federation import game
-from federation.web import *
+from avenue.api import *
from os import path, listdir
def _get_header():
@@ -24,7 +24,7 @@ def _get_header():
else:
return ''
-def index():
+def game_index():
'''Creates an html page that uses javascript with canvas to format
the main game board. This serves as a client built into the server
so that downloading an external client is not required.

0 comments on commit 25701d2

Please sign in to comment.