Skip to content

Commit ababb57

Browse files
yuyichaostevengj
authored andcommitted
Fix most of 0.7 depwarns (#306)
1 parent 4a175a8 commit ababb57

File tree

4 files changed

+17
-18
lines changed

4 files changed

+17
-18
lines changed

REQUIRE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
julia 0.4
1+
julia 0.5
22
PyCall 1.6.2
33
Colors
44
LaTeXStrings
5-
Compat 0.8.0
5+
Compat 0.27.0

src/PyPlot.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Base: convert, ==, isequal, hash, getindex, setindex!, haskey, keys, show
88
export Figure, plt, matplotlib, pygui, withfig
99

1010
using Compat
11-
@compat import Base.show
11+
import Base.show
1212

1313
# Wrapper around matplotlib Figure, supporting graphics I/O and pretty display
1414
type Figure
@@ -22,13 +22,13 @@ end
2222
# to load up all of the documentation strings right away.
2323
immutable LazyHelp
2424
o::PyObject
25-
keys::Tuple{Vararg{Compat.String}}
25+
keys::Tuple{Vararg{String}}
2626
LazyHelp(o::PyObject) = new(o, ())
2727
LazyHelp(o::PyObject, k::AbstractString) = new(o, (k,))
2828
LazyHelp(o::PyObject, k1::AbstractString, k2::AbstractString) = new(o, (k1,k2))
2929
LazyHelp(o::PyObject, k::Tuple{Vararg{AbstractString}}) = new(o, k)
3030
end
31-
@compat function show(io::IO, ::MIME"text/plain", h::LazyHelp)
31+
function show(io::IO, ::MIME"text/plain", h::LazyHelp)
3232
o = h.o
3333
for k in h.keys
3434
o = o[k]
@@ -39,11 +39,11 @@ end
3939
print(io, "no Python docstring found for ", h.k)
4040
end
4141
end
42-
Base.show(io::IO, h::LazyHelp) = @compat show(io, "text/plain", h)
42+
Base.show(io::IO, h::LazyHelp) = show(io, "text/plain", h)
4343
function Base.Docs.catdoc(hs::LazyHelp...)
4444
Base.Docs.Text() do io
4545
for h in hs
46-
@compat show(io, MIME"text/plain"(), h)
46+
show(io, MIME"text/plain"(), h)
4747
end
4848
end
4949
end
@@ -62,7 +62,7 @@ convert(::Type{Figure}, o::PyObject) = Figure(o)
6262
==(f::PyObject, g::Figure) = f == g.o
6363
hash(f::Figure) = hash(f.o)
6464
pycall(f::Figure, args...; kws...) = pycall(f.o, args...; kws...)
65-
@compat (f::Figure)(args...; kws...) = pycall(f.o, PyAny, args...; kws...)
65+
(f::Figure)(args...; kws...) = pycall(f.o, PyAny, args...; kws...)
6666
Base.Docs.doc(f::Figure) = Base.Docs.doc(f.o)
6767

6868
getindex(f::Figure, x) = getindex(f.o, x)
@@ -71,10 +71,10 @@ haskey(f::Figure, x) = haskey(f.o, x)
7171
keys(f::Figure) = keys(f.o)
7272

7373
for (mime,fmt) in aggformats
74-
@eval @compat function show(io::IO, m::MIME{Symbol($mime)}, f::Figure)
74+
@eval function show(io::IO, m::MIME{Symbol($mime)}, f::Figure)
7575
if !haskey(pycall(f.o["canvas"]["get_supported_filetypes"], PyDict),
7676
$fmt)
77-
throw(MethodError(@static(VERSION < v"0.5.0-dev+4340" ? writemime : show), (io, m, f)))
77+
throw(MethodError(show, (io, m, f)))
7878
end
7979
f.o["canvas"]["print_figure"](io, format=$fmt, bbox_inches="tight")
8080
end

src/colormaps.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ convert(::Type{ColorMap}, o::PyObject) = ColorMap(o)
1818
==(c::ColorMap, g::PyObject) = c.o == g
1919
hash(c::ColorMap) = hash(c.o)
2020
pycall(c::ColorMap, args...; kws...) = pycall(c.o, args...; kws...)
21-
@compat (c::ColorMap)(args...; kws...) = pycall(c.o, PyAny, args...; kws...)
21+
(c::ColorMap)(args...; kws...) = pycall(c.o, PyAny, args...; kws...)
2222
Base.Docs.doc(c::ColorMap) = Base.Docs.doc(c.o)
2323

2424
getindex(c::ColorMap, x) = getindex(c.o, x)
@@ -155,8 +155,7 @@ get_cmaps() =
155155
########################################################################
156156
# display of ColorMaps as a horizontal color bar in SVG
157157

158-
@compat function show(io::IO, ::MIME"image/svg+xml",
159-
cs::AbstractVector{ColorMap})
158+
function show(io::IO, ::MIME"image/svg+xml", cs::AbstractVector{ColorMap})
160159
n = 256
161160
nc = length(cs)
162161
a = linspace(0,1,n)
@@ -186,8 +185,8 @@ get_cmaps() =
186185
write(io, "</svg>")
187186
end
188187

189-
@compat function show(io::IO, m::MIME"image/svg+xml", c::ColorMap)
190-
@compat show(io, m, [c])
188+
function show(io::IO, m::MIME"image/svg+xml", c::ColorMap)
189+
show(io, m, [c])
191190
end
192191

193192
########################################################################

src/init.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ function find_backend(matplotlib::PyObject)
4949
:qt_pyside=>"Qt4Agg", :qt4=>"Qt4Agg",
5050
:qt5=>"Qt5Agg", :qt=>"Qt4Agg",:tk=>"TkAgg")
5151
conda = PyCall.conda || !isempty(PyCall.anaconda_conda())
52-
if is_linux()
52+
if Compat.Sys.islinux()
5353
guis = [:tk, :gtk3, :gtk, :qt5, :qt4, :wx]
54-
elseif is_apple() && conda # partially work around #164
54+
elseif Compat.Sys.isapple() && conda # partially work around #164
5555
guis = [:qt5, :qt4, :tk, :wx, :gtk, :gtk3]
5656
else
5757
guis = [:tk, :qt5, :qt4, :wx, :gtk, :gtk3]
@@ -108,7 +108,7 @@ function find_backend(matplotlib::PyObject)
108108
# throw exception (drop to catch block below) if DISPLAY
109109
# is not set. [Might be more reliable to test
110110
# success(`xdpyinfo`), but only if xdpyinfo is installed.]
111-
if options[1][1] != :none && is_unix() && !is_apple()
111+
if options[1][1] != :none && Compat.Sys.isunix() && !Compat.Sys.isapple()
112112
ENV["DISPLAY"]
113113
end
114114

0 commit comments

Comments
 (0)