From 7e26270b2cbae199608711f17e17b6793992f039 Mon Sep 17 00:00:00 2001 From: "Paul R. Tagliamonte" Date: Sat, 9 Mar 2013 22:47:25 -0500 Subject: [PATCH] Bit of cleanup. --- Makefile | 1 + site/shim.py | 16 ++++------------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index c9e52b8..f47d4b8 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ tox: venv flake: flake8 hy + flake8 site clear: clear diff --git a/site/shim.py b/site/shim.py index 3750cba..938a6b7 100644 --- a/site/shim.py +++ b/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