From 300babd6b1e71ea83f42ab3baccf5da4cd918098 Mon Sep 17 00:00:00 2001 From: Thomas Breloff Date: Tue, 24 May 2016 14:46:53 -0400 Subject: [PATCH] deprecated gadfly/immerse --- src/backends.jl | 16 ++++++++++++---- test/runtests.jl | 22 +++++++++++----------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/backends.jl b/src/backends.jl index 5b78aab6..e7ca5ec3 100644 --- a/src/backends.jl +++ b/src/backends.jl @@ -137,13 +137,21 @@ end Set the plot backend. """ function backend(pkg::AbstractBackend) - CURRENT_BACKEND.sym = backend_name(pkg) - CURRENT_BACKEND.pkg = pkg + CURRENT_BACKEND.sym = backend_name(pkg) + warn_on_deprecated_backend(CURRENT_BACKEND.sym) + CURRENT_BACKEND.pkg = pkg end function backend(modname::Symbol) - CURRENT_BACKEND.sym = modname - CURRENT_BACKEND.pkg = _backend_instance(modname) + warn_on_deprecated_backend(modname) + CURRENT_BACKEND.sym = modname + CURRENT_BACKEND.pkg = _backend_instance(modname) +end + +function warn_on_deprecated_backend(bsym::Symbol) + if bsym in (:qwt, :winston, :bokeh, :gadfly, :immerse) + warn("Backend $bsym has been deprecated. It may not work as originally intended.") + end end # --------------------------------------------------------- diff --git a/test/runtests.jl b/test/runtests.jl index a73566f3..7e5becc1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -7,17 +7,17 @@ srand(1234) default(show=false, reuse=true) img_eps = 5e-2 -facts("Gadfly") do - @fact gadfly() --> Plots.GadflyBackend() - @fact backend() --> Plots.GadflyBackend() - - @fact typeof(plot(1:10)) --> Plots.Plot{Plots.GadflyBackend} - @fact plot(Int[1,2,3], rand(3)) --> not(nothing) - @fact plot(sort(rand(10)), rand(Int, 10, 3)) --> not(nothing) - @fact plot!(rand(10,3), rand(10,3)) --> not(nothing) - - image_comparison_facts(:gadfly, skip=[4,6,23,24,27], eps=img_eps) -end +# facts("Gadfly") do +# @fact gadfly() --> Plots.GadflyBackend() +# @fact backend() --> Plots.GadflyBackend() +# +# @fact typeof(plot(1:10)) --> Plots.Plot{Plots.GadflyBackend} +# @fact plot(Int[1,2,3], rand(3)) --> not(nothing) +# @fact plot(sort(rand(10)), rand(Int, 10, 3)) --> not(nothing) +# @fact plot!(rand(10,3), rand(10,3)) --> not(nothing) +# +# image_comparison_facts(:gadfly, skip=[4,6,23,24,27], eps=img_eps) +# end facts("PyPlot") do @fact pyplot() --> Plots.PyPlotBackend()