@@ -8,7 +8,7 @@ import Base: convert, ==, isequal, hash, getindex, setindex!, haskey, keys, show
8
8
export Figure, plt, matplotlib, pygui, withfig
9
9
10
10
using Compat
11
- @compat import Base. show
11
+ import Base. show
12
12
13
13
# Wrapper around matplotlib Figure, supporting graphics I/O and pretty display
14
14
type Figure
22
22
# to load up all of the documentation strings right away.
23
23
immutable LazyHelp
24
24
o:: PyObject
25
- keys:: Tuple{Vararg{Compat. String}}
25
+ keys:: Tuple{Vararg{String}}
26
26
LazyHelp (o:: PyObject ) = new (o, ())
27
27
LazyHelp (o:: PyObject , k:: AbstractString ) = new (o, (k,))
28
28
LazyHelp (o:: PyObject , k1:: AbstractString , k2:: AbstractString ) = new (o, (k1,k2))
29
29
LazyHelp (o:: PyObject , k:: Tuple{Vararg{AbstractString}} ) = new (o, k)
30
30
end
31
- @compat function show (io:: IO , :: MIME"text/plain" , h:: LazyHelp )
31
+ function show (io:: IO , :: MIME"text/plain" , h:: LazyHelp )
32
32
o = h. o
33
33
for k in h. keys
34
34
o = o[k]
39
39
print (io, " no Python docstring found for " , h. k)
40
40
end
41
41
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)
43
43
function Base. Docs. catdoc (hs:: LazyHelp... )
44
44
Base. Docs. Text () do io
45
45
for h in hs
46
- @compat show (io, MIME " text/plain" (), h)
46
+ show (io, MIME " text/plain" (), h)
47
47
end
48
48
end
49
49
end
@@ -62,7 +62,7 @@ convert(::Type{Figure}, o::PyObject) = Figure(o)
62
62
== (f:: PyObject , g:: Figure ) = f == g. o
63
63
hash (f:: Figure ) = hash (f. o)
64
64
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... )
66
66
Base. Docs. doc (f:: Figure ) = Base. Docs. doc (f. o)
67
67
68
68
getindex (f:: Figure , x) = getindex (f. o, x)
@@ -71,10 +71,10 @@ haskey(f::Figure, x) = haskey(f.o, x)
71
71
keys (f:: Figure ) = keys (f. o)
72
72
73
73
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 )
75
75
if ! haskey (pycall (f. o[" canvas" ][" get_supported_filetypes" ], PyDict),
76
76
$ fmt)
77
- throw (MethodError (@static ( VERSION < v " 0.5.0-dev+4340 " ? writemime : show) , (io, m, f)))
77
+ throw (MethodError (show, (io, m, f)))
78
78
end
79
79
f. o[" canvas" ][" print_figure" ](io, format= $ fmt, bbox_inches= " tight" )
80
80
end
0 commit comments