(POST "/add-resort" {params :params} (p/add-resort params))
(defn add-resort [params] (let [{{tempfile :tempfile filename :filename} :resort-pano resort-geojsons :resort-geojsons resort-name :resort-name} params filepath (str "resources/public/images/panos/" resort-name "/" filename)] (h/save-file tempfile filepath) (for [geojson resort-geojsons :let [{tempfile :tempfile filename :filename} geojson filepath (str "resources/public/data/" resort-name "/" filename)]] (h/save-file tempfile filepath)) (h/process-pano filepath resort-name) (edit-for-resort resort-name)))
(defn save-file [tempfile filepath] (io/make-parents filepath) (io/copy tempfile (io/file filepath)))
(defn process-pano [filepath resort-name] (println (sh "ruby" (absolute-path (io/resource "tiler.rb")) (absolute-path filepath) (absolute-path (str "resources/public/images/panos/" resort-name "/")) "5")))
--
You received this message because you are subscribed to the Google Groups "Compojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to compojure+...@googlegroups.com.
To post to this group, send email to comp...@googlegroups.com.
Visit this group at http://groups.google.com/group/compojure.
For more options, visit https://groups.google.com/d/optout.
;; Nothing is printed because map returns a lazy-seq
user=> (def foo (map println [1 2 3]))
#'user/foo
;; doall forces the seq to be realized
user=> (def foo (doall (map println [1 2 3])))
1
2
3
#'user/foo
;;can define infinite sequence of number
(def infinite (map inc (range)))
;;forcing with doall would fill all my RAM, but may be I only need two
(take 2 infinite)