Skip to content

Commit

Permalink
Internal renaming of ipython-clojure to clojupyter.
Browse files Browse the repository at this point in the history
  • Loading branch information
roryk committed Aug 28, 2016
1 parent 3401bc6 commit 7f13c72
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 61 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
all:
lein uberjar
cat bin/ipython-clojure.template $$(find . -maxdepth 2 -type f | grep -e ".*standalone.*\.jar") > bin/ipython-clojure
chmod +x bin/ipython-clojure
cat bin/clojupyter.template $$(find . -maxdepth 2 -type f | grep -e ".*standalone.*\.jar") > bin/clojupyter
chmod +x bin/clojupyter

clean:
rm -f *.jar
rm -f target/*.jar
rm -f bin/ipython-clojure
rm -f bin/clojuypyter

install:
mkdir -p ~/.ipython/kernels/clojure
cp bin/ipython-clojure ~/.ipython/kernels/clojure/ipython-clojure
cp bin/clojupyter ~/.ipython/kernels/clojure/clojupyter
@if [ ! -f ~/.ipython/kernels/clojure/kernel.json ]; then\
sed 's|HOME|'${HOME}'|' resources/kernel.json > ~/.ipython/kernels/clojure/kernel.json;\
fi
40 changes: 0 additions & 40 deletions bin/ipython-clojure.template

This file was deleted.

8 changes: 4 additions & 4 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(defproject ipython-clojure "0.1.0-SNAPSHOT"
(defproject clojupyter "0.1.0-SNAPSHOT"
:description "An IPython kernel for executing Clojure code"
:url "http://github.com/roryk/ipython-clojure"
:url "http://github.com/roryk/clojupyter"
:license {:name "MIT"}
:dependencies [[org.clojure/clojure "1.8.0"]
[org.zeromq/jeromq "0.3.4"] ; "0.3.5" (modern) fails on zmq/bind.
Expand All @@ -13,7 +13,7 @@
[mvxcvi/puget "1.0.0"]
[fipp "0.6.4"]
[org.clojure/tools.nrepl "0.2.12"]]
:aot [ipython-clojure.core]
:main ipython-clojure.core
:aot [clojupyter.core]
:main clojupyter.core
:jvm-opts ["-Xmx250m"]
:keep-non-project-classes true)
2 changes: 1 addition & 1 deletion resources/kernel.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"argv": ["HOME/.ipython/kernels/clojure/ipython-clojure", "{connection_file}"],
"argv": ["HOME/.ipython/kernels/clojure/clojupyter", "{connection_file}"],
"display_name": "Clojure",
"language": "clojure"
}
12 changes: 6 additions & 6 deletions src/ipython_clojure/core.clj → src/clojupyter/core.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns ipython-clojure.core
(ns clojupyter.core
(:require
[ipython-clojure.middleware.pprint]
[ipython-clojure.middleware.stacktrace]
[clojupyter.middleware.pprint]
[clojupyter.middleware.stacktrace]
[clojure.data.json :as json]
[clojure.java.io :as io]
[cheshire.core :as cheshire]
Expand Down Expand Up @@ -346,9 +346,9 @@

(def clojupyter-middleware
"A vector containing all Clojupyters middleware (additions to nrepl default)."
'[ipython-clojure.middleware.pprint/wrap-pprint
ipython-clojure.middleware.pprint/wrap-pprint-fn
ipython-clojure.middleware.stacktrace/wrap-stacktrace])
'[clojupyter.middleware.pprint/wrap-pprint
clojupyter.middleware.pprint/wrap-pprint-fn
clojupyter.middleware.stacktrace/wrap-stacktrace])

(def clojupyer-nrepl-handler
"Clojupyters nREPL handler."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns ipython-clojure.middleware.pprint
(ns clojupyter.middleware.pprint
(:require [clojure.pprint :refer [pprint *print-right-margin*]]
[clojure.tools.nrepl.middleware.interruptible-eval :refer [*msg*]]
[clojure.tools.nrepl.middleware.pr-values :refer [pr-values]]
Expand Down Expand Up @@ -88,7 +88,7 @@
;; PrintWriter (as created by `pprint-writer`), which the client requires to
;; handle the response correctly.
(binding [*msg* msg *out* writer]
(let [value (:value response)
(let [value (:value response)
print-fn (if (string? value) println pprint-fn)]
(print-fn value))))
(transport/send transport (response-for msg :pprint-sentinel {})))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns ipython-clojure.middleware.stacktrace
(ns clojupyter.middleware.stacktrace
"Cause and stacktrace analysis for exceptions"
{:author "Jeff Valk"}
(:require [ipython-clojure.middleware.pprint :as pprint]
(:require [clojupyter.middleware.pprint :as pprint]
[clojure.repl :as repl]
[clojure.string :as str]
[clojure.tools.nrepl.middleware :refer [set-descriptor!]]
Expand Down Expand Up @@ -174,10 +174,10 @@
;; nREPL middleware descriptor info
(set-descriptor!
#'wrap-stacktrace
{:requires #{#'session #'pprint/wrap-pprint-fn}
{:requires #{#'session #'pprint/wrap-pprint-fn}
:expects #{}
:handles {"stacktrace"
{:doc (str "Return messages describing each cause and stack frame "
"of the most recent exception.")
:optional pprint/wrap-pprint-fn-optional-arguments
:optional pprint/wrap-pprint-fn-optional-arguments
:returns {"status" "\"done\", or \"no-error\" if `*e` is nil"}}}})

0 comments on commit 7f13c72

Please sign in to comment.