Rushed fix for the contrib.meth macros
This commit is contained in:
parent
5a82585a7f
commit
8717d40e19
@ -28,7 +28,7 @@ from hy.macros import macro
|
|||||||
|
|
||||||
|
|
||||||
def router(tree, rkwargs=None):
|
def router(tree, rkwargs=None):
|
||||||
tree.pop(0)
|
tree = HyExpression(tree)
|
||||||
name = tree.pop(0)
|
name = tree.pop(0)
|
||||||
path = tree.pop(0)
|
path = tree.pop(0)
|
||||||
tree.insert(0, HySymbol("fn"))
|
tree.insert(0, HySymbol("fn"))
|
||||||
@ -44,15 +44,15 @@ def router(tree, rkwargs=None):
|
|||||||
|
|
||||||
|
|
||||||
@macro("route")
|
@macro("route")
|
||||||
def route_macro(tree):
|
def route_macro(*tree):
|
||||||
return router(tree)
|
return router(tree)
|
||||||
|
|
||||||
|
|
||||||
@macro("post_route")
|
@macro("post_route")
|
||||||
def post_route_macro(tree):
|
def post_route_macro(*tree):
|
||||||
return router(tree, rkwargs=HyList([HyString("POST")]))
|
return router(tree, rkwargs=HyList([HyString("POST")]))
|
||||||
|
|
||||||
|
|
||||||
@macro("get_route")
|
@macro("get_route")
|
||||||
def get_route_macro(tree):
|
def get_route_macro(*tree):
|
||||||
return router(tree, rkwargs=HyList([HyString("GET")]))
|
return router(tree, rkwargs=HyList([HyString("GET")]))
|
||||||
|
Loading…
Reference in New Issue
Block a user