Bit of cleanup.
This commit is contained in:
parent
aecf29809f
commit
7e26270b2c
16
site/shim.py
16
site/shim.py
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user