Bit of cleanup.

This commit is contained in:
Paul R. Tagliamonte 2013-03-09 22:47:25 -05:00
parent aecf29809f
commit 7e26270b2c
2 changed files with 5 additions and 12 deletions

View File

@ -30,6 +30,7 @@ tox: venv
flake:
flake8 hy
flake8 site
clear:
clear

View File

@ -1,6 +1,6 @@
#
import hy
import hy # NOQA
from hy.models.expression import HyExpression
from hy.models.symbol import HySymbol
@ -8,16 +8,10 @@ from hy.models.symbol import HySymbol
from hy.macros import macro
# (route "/" []
# (render-template "index.html"))
# (decorate-with (.route app "/")
# (defn index []
# (render-template "index.html")))
@macro("route")
def route_macro(tree):
""" Simple routing macro """
tree.pop(0)
path = tree.pop(0)
tree.insert(0, HySymbol("fn"))
@ -25,9 +19,7 @@ def route_macro(tree):
return HyExpression([HySymbol("decorate_with"),
HyExpression([HySymbol(".route"),
HySymbol("app"),
path]),
tree])
path]), tree])
from app import app