Update hy to 0.10.0
This commit is contained in:
parent
e0158bc47b
commit
2e6dcfd74b
3 changed files with 20 additions and 19 deletions
10
hypo.hy
10
hypo.hy
|
@ -90,17 +90,17 @@ If no lexer is found fallback onto the text lexer."
|
||||||
(let ((content (get (.commit-file repo ref filename) "data"))
|
(let ((content (get (.commit-file repo ref filename) "data"))
|
||||||
(lexer (get-lexer filename content))
|
(lexer (get-lexer filename content))
|
||||||
(formatter (HtmlFormatter))
|
(formatter (HtmlFormatter))
|
||||||
(args {"file" filename "hash" hash}))
|
(kwargs {"file" filename "hash" hash}))
|
||||||
(.update
|
(.update
|
||||||
args (if (in (get (os.path.splitext filename) 1)
|
kwargs (if (in (get (os.path.splitext filename) 1)
|
||||||
[".png" ".jpg" ".jpeg" ".gif"])
|
[".png" ".jpg" ".jpeg" ".gif"])
|
||||||
{"content" (kwapply (render.image)
|
{"content" (apply render.image []
|
||||||
{"name" filename
|
{"name" filename
|
||||||
"hash" hash})
|
"hash" hash})
|
||||||
"style" ""}
|
"style" ""}
|
||||||
{"content" (highlight content lexer formatter)
|
{"content" (highlight content lexer formatter)
|
||||||
"style" (formatter.get-style-defs ".highlight")}))
|
"style" (formatter.get-style-defs ".highlight")}))
|
||||||
(kwapply (render.main) args))
|
(apply render.main [] kwargs))
|
||||||
""))
|
""))
|
||||||
|
|
||||||
(defun get-html [self name]
|
(defun get-html [self name]
|
||||||
|
@ -129,7 +129,7 @@ If no lexer is found fallback onto the text lexer."
|
||||||
(.write f (web.data)))
|
(.write f (web.data)))
|
||||||
(let ((repo (Gittle.init dirname)))
|
(let ((repo (Gittle.init dirname)))
|
||||||
(.stage repo [(str name)])
|
(.stage repo [(str name)])
|
||||||
(kwapply (repo.commit)
|
(apply repo.commit []
|
||||||
{"name" "Hypo"
|
{"name" "Hypo"
|
||||||
"email" "hypo@ryuslash.org"
|
"email" "hypo@ryuslash.org"
|
||||||
"message" "Initial commit"}))
|
"message" "Initial commit"}))
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
hy==0.9.12
|
hy==0.10.0
|
||||||
gittle==0.2.2
|
gittle==0.2.2
|
||||||
pycommand==0.1.0
|
pycommand==0.1.0
|
||||||
web.py==0.37
|
web.py==0.37
|
||||||
|
|
|
@ -25,11 +25,12 @@
|
||||||
(sys.exit 1)))
|
(sys.exit 1)))
|
||||||
|
|
||||||
(def db
|
(def db
|
||||||
(kwapply (web.database)
|
(apply web.database []
|
||||||
{"dbn" "postgres" "user" *dbuser* "pw" *dbpw* "db" *dbname*}))
|
{"dbn" "postgres" "user" *dbuser* "pw" *dbpw* "db" *dbname*}))
|
||||||
|
|
||||||
(defun get-file [name]
|
(defun get-file [name]
|
||||||
(let ((res (kwapply (.select db "hfile" {"shash" name})
|
(let ((res (apply .select
|
||||||
|
[db "hfile" {"shash" name}]
|
||||||
{"where" "shash = $shash"})))
|
{"where" "shash = $shash"})))
|
||||||
(if res (car res))))
|
(if res (car res))))
|
||||||
|
|
||||||
|
@ -42,7 +43,7 @@
|
||||||
(+ "files/" f "/" file.filename))
|
(+ "files/" f "/" file.filename))
|
||||||
(let ((repo (Gittle.init (+ "files/" f))))
|
(let ((repo (Gittle.init (+ "files/" f))))
|
||||||
(.stage repo [(str file.filename)])
|
(.stage repo [(str file.filename)])
|
||||||
(kwapply (repo.commit)
|
(apply repo.commit []
|
||||||
{"name" "System"
|
{"name" "System"
|
||||||
"email" "tom@ryuslash.org"
|
"email" "tom@ryuslash.org"
|
||||||
"message" "Initial commit for upgrade to git"}))))
|
"message" "Initial commit for upgrade to git"}))))
|
||||||
|
|
Loading…
Reference in a new issue