heheheh
This commit is contained in:
parent
90446be352
commit
96a104e060
11
eg/flask/app.hy
Normal file
11
eg/flask/app.hy
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
; Copyright (c) Paul R. Tagliamonte <tag@pault.ag>, 2013
|
||||||
|
|
||||||
|
(import-from flask Flask render-template)
|
||||||
|
|
||||||
|
|
||||||
|
(def app (Flask "__main__"))
|
||||||
|
|
||||||
|
|
||||||
|
(decorate-with (.route app "/")
|
||||||
|
(defn index []
|
||||||
|
(render-template "index.html")))
|
5
eg/flask/shim.py
Normal file
5
eg/flask/shim.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import hy.lang.importer
|
||||||
|
from app import app
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app.run(debug=True)
|
1
eg/flask/templates/index.html
Normal file
1
eg/flask/templates/index.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<h1>It works!</h1>
|
@ -1,6 +0,0 @@
|
|||||||
; vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 filetype=lisp
|
|
||||||
; Copyright (c) Paul Tagliamonte, in sofar as any of this is at all
|
|
||||||
; copyrightable.
|
|
||||||
|
|
||||||
(loop (print (eval (read))))
|
|
||||||
; Yes folks, this is where REPL comes from.
|
|
@ -1,10 +0,0 @@
|
|||||||
; vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 filetype=lisp
|
|
||||||
; Copyright (c) Paul Tagliamonte, in sofar as any of this is at all
|
|
||||||
; copyrightable.
|
|
||||||
|
|
||||||
(import ["json"])
|
|
||||||
|
|
||||||
(print "I'll eval s-expressions you input")
|
|
||||||
(loop (print
|
|
||||||
(kwapply (json.dumps
|
|
||||||
(lex (read))) {"sort_keys" true "indent" 4})))
|
|
Loading…
x
Reference in New Issue
Block a user