Skip to content

Commit

Permalink
Work around jupyter/notebook#448. revert when
Browse files Browse the repository at this point in the history
jupyter/notebook#448 is closed and released.
  • Loading branch information
dhoegh committed Sep 22, 2015
1 parent bd44868 commit 52c00d6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
12 changes: 8 additions & 4 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ENV["PYTHONIOENCODING"] = "UTF-8"


const jupyter, jupyter_vers = try
"jupyter",convert(VersionNumber, chomp(readall(`jupyter kernelspec --version`)))
"jupyter",convert(VersionNumber, chomp(readall(`jupyter-kernelspec --version`)))
catch e1
try
"ipython",convert(VersionNumber, chomp(readall(`ipython --version`)))
Expand All @@ -32,7 +32,7 @@ catch e1
"IJulia will use the python distribution in the Conda package")
Conda.add("jupyter")
try
joinpath(Conda.SCRIPTDIR,"jupyter"),convert(VersionNumber, chomp(readall(`$(joinpath(Conda.SCRIPTDIR,"jupyter")) kernelspec --version`)))
joinpath(Conda.SCRIPTDIR,"jupyter"),convert(VersionNumber, chomp(readall(`$(joinpath(Conda.SCRIPTDIR,"jupyter-kernelspec")) --version`)))
catch e6
error("Jupyter could not be found in Conda.jl, got the following error\n",
" $e6\n" )
Expand Down Expand Up @@ -111,8 +111,12 @@ copy_config("logo-32x32.png", juliakspec)
copy_config("logo-64x64.png", juliakspec)

eprintln("Installing julia kernelspec $spec_name")
run(`$jupyter kernelspec install --replace --user $juliakspec`)

if basename(jupyter) == "jupyter"
# Remove the commit that added this when https://github.com/jupyter/notebook/issues/448 is closed
run(`$jupyter-kernelspec install --replace --user $juliakspec`)
else
run(`$jupyter-kernelspec install --replace --user $juliakspec`)
end
open("deps.jl", "w") do f
print(f, """
const jupyter = "$(escape_string(jupyter))"
Expand Down
7 changes: 6 additions & 1 deletion src/IJulia.jl
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,12 @@ end
export notebook
function notebook(jupyter=jupyter)
inited && error("IJulia is already running")
run(`$jupyter notebook`)
if basename(jupyter) == "jupyter"
# Remove the commit that added this when https://github.com/jupyter/notebook/issues/448 is closed
run(`$jupyter-notebook`)
else
run(`$jupyter notebook`)
end
end

end # IJulia

0 comments on commit 52c00d6

Please sign in to comment.