aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2014-01-23 21:27:54 +0100
committerGravatar Tom Willemse2014-01-23 21:27:54 +0100
commitf045a284631b035140c92cd3a3b663ff764167fc (patch)
tree37ff554e4d52f2b2b9ba7f69b505cb628e6fe27e
parent8e599478f7420e8e585cb01037dc776332cc02b6 (diff)
downloadhypo-f045a284631b035140c92cd3a3b663ff764167fc.tar.gz
hypo-f045a284631b035140c92cd3a3b663ff764167fc.zip
Update for compatibility with hy 0.9.12
-rwxr-xr-xhypo.hy8
-rwxr-xr-xhypoctl14
2 files changed, 11 insertions, 11 deletions
diff --git a/hypo.hy b/hypo.hy
index 4e9dcb1..a8e27b9 100755
--- a/hypo.hy
+++ b/hypo.hy
@@ -44,12 +44,12 @@
(defun get-type [ext]
(cond
- ((in ext (, ".jpg" ".jpeg" ".png" ".gif")) "image")
- (true "text")))
+ [(in ext (, ".jpg" ".jpeg" ".png" ".gif")) "image"]
+ [True "text"]))
(defun read-file [filename]
(let (res)
- (with [f (file filename "r")]
+ (with [[f (file filename "r")]]
(setv res (f.read)))
res))
@@ -124,7 +124,7 @@ If no lexer is found fallback onto the text lexer."
(let ((h (hashes name))
(dirname (+ "files/" (get h 0))))
(os.mkdir dirname)
- (with [f (file (+ dirname "/" name) "w")]
+ (with [[f (file (+ dirname "/" name) "w")]]
(.write f (web.data)))
(let ((repo (Gittle.init dirname)))
(.stage repo [(str name)])
diff --git a/hypoctl b/hypoctl
index e57e9eb..15dd6c8 100755
--- a/hypoctl
+++ b/hypoctl
@@ -23,16 +23,16 @@
[description "Control hypo"]
[run (lambda [self]
(cond
- ((not self.args)
- (progn (print self.usage) 2))
- ((= (car self.args) "start")
- (hypo-start (cdr self.args)))
- (True
+ [(not self.args)
+ (progn (print self.usage) 2)]
+ [(= (car self.args) "start")
+ (hypo-start (cdr self.args))]
+ [True
(print (.format "error: command {0} does not exist"
- (car self.args))))))]])
+ (car self.args)))]))]])
(when (= __name__ "__main__")
- (let ((cmd (hypoctl-command (cdr (cdr sys.argv)))))
+ (let ((cmd (hypoctl-command (cdr sys.argv))))
(if cmd.error
(progn (print (.format "error: {0}" cmd.error))
(sys.exit 1))