From d74715f1561a3bcb29197c0cf50b949281df7898 Mon Sep 17 00:00:00 2001 From: Giorgio Calderone Date: Sat, 25 Apr 2020 19:28:57 +0200 Subject: [PATCH] Fixed initialization in Juno --- ChangeLog.md | 8 ++++++++ docs/make.jl | 2 +- src/Gnuplot.jl | 21 +++++++++++---------- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index a5a367f..221e21b 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,11 @@ +# Version 1.3.0 (not yet released) +mime +gpviewer +term_svg, term_png +contourlines(x::AbstractVector{Float64}, y::AbstractVector{Float64}, z::AbstractMatrix{Float64}, +save(mime) + + # Version 1.2.0 (released on: Apr. 20, 2020) - New features: diff --git a/docs/make.jl b/docs/make.jl index 8825f02..18c00d7 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -3,7 +3,7 @@ empty!(Gnuplot.options.mime) makedocs(sitename="Gnuplot.jl", authors = "Giorgio Calderone", - #format = Documenter.HTML(prettyurls = false), # uncomment for local use, comment for deployment + format = Documenter.HTML(prettyurls = false), # uncomment for local use, comment for deployment modules=[Gnuplot], pages = [ "Home" => "index.md", diff --git a/src/Gnuplot.jl b/src/Gnuplot.jl index 3f74424..b2d12ee 100644 --- a/src/Gnuplot.jl +++ b/src/Gnuplot.jl @@ -230,17 +230,19 @@ end # ╭───────────────────────────────────────────────────────────────────╮ -# │ GLOBAL VARIABLES │ +# │ GLOBAL VARIABLES AND MODULE INITIALIZATION │ # ╰───────────────────────────────────────────────────────────────────╯ const sessions = OrderedDict{Symbol, Session}() const options = Options() -# Trick to check whether we are running in a IJulia or Juno -# session. Copied from Gaston.jl. -options.gpviewer = !( - ((isdefined(Main, :IJulia) && Main.IJulia.inited) || - (isdefined(Main, :Juno) && Main.Juno.isactive())) -) +function __init__() + # Check whether we are running in a IJulia or Juno session. + # (copied from Gaston.jl). + options.gpviewer = !( + ((isdefined(Main, :IJulia) && Main.IJulia.inited) || + (isdefined(Main, :Juno) && Main.Juno.isactive())) + ) +end # ╭───────────────────────────────────────────────────────────────────╮ @@ -1307,8 +1309,7 @@ function driver(_args...; is3d=false) if options.gpviewer && doDump execall(gp) end - out = SessionID(gp.sid, doDump) - return out + return SessionID(gp.sid, doDump) end @@ -1320,7 +1321,7 @@ end Return the **Gnuplot.jl** package version. """ -version() = v"1.2.1-dev" +version() = v"1.3.0-dev" # --------------------------------------------------------------------- """