Bit of cleanup.
This commit is contained in:
parent
aecf29809f
commit
7e26270b2c
1
Makefile
1
Makefile
@ -30,6 +30,7 @@ tox: venv
|
|||||||
|
|
||||||
flake:
|
flake:
|
||||||
flake8 hy
|
flake8 hy
|
||||||
|
flake8 site
|
||||||
|
|
||||||
clear:
|
clear:
|
||||||
clear
|
clear
|
||||||
|
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.expression import HyExpression
|
||||||
from hy.models.symbol import HySymbol
|
from hy.models.symbol import HySymbol
|
||||||
@ -8,16 +8,10 @@ from hy.models.symbol import HySymbol
|
|||||||
from hy.macros import macro
|
from hy.macros import macro
|
||||||
|
|
||||||
|
|
||||||
# (route "/" []
|
|
||||||
# (render-template "index.html"))
|
|
||||||
|
|
||||||
# (decorate-with (.route app "/")
|
|
||||||
# (defn index []
|
|
||||||
# (render-template "index.html")))
|
|
||||||
|
|
||||||
|
|
||||||
@macro("route")
|
@macro("route")
|
||||||
def route_macro(tree):
|
def route_macro(tree):
|
||||||
|
""" Simple routing macro """
|
||||||
|
|
||||||
tree.pop(0)
|
tree.pop(0)
|
||||||
path = tree.pop(0)
|
path = tree.pop(0)
|
||||||
tree.insert(0, HySymbol("fn"))
|
tree.insert(0, HySymbol("fn"))
|
||||||
@ -25,9 +19,7 @@ def route_macro(tree):
|
|||||||
return HyExpression([HySymbol("decorate_with"),
|
return HyExpression([HySymbol("decorate_with"),
|
||||||
HyExpression([HySymbol(".route"),
|
HyExpression([HySymbol(".route"),
|
||||||
HySymbol("app"),
|
HySymbol("app"),
|
||||||
path]),
|
path]), tree])
|
||||||
tree])
|
|
||||||
|
|
||||||
|
|
||||||
from app import app
|
from app import app
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user