From ba0bb2fc756deaa8f02cc58148fc4ef9095e85ff Mon Sep 17 00:00:00 2001 From: bnewbold Date: Sun, 21 Feb 2016 18:45:17 -0800 Subject: add conditional (py3) writeSVGfile function export --- src/PyX.jl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/PyX.jl b/src/PyX.jl index b4097a9..9210f5e 100644 --- a/src/PyX.jl +++ b/src/PyX.jl @@ -12,8 +12,9 @@ export graph, graph_axis, graph_axis_painter, graph_data, graph_style, graph_sty export graph_graphxyz, graph_data_function export epsfile, deformer, trafo, attr, metapost_path export plot, stroke -export writeEPSfile, writePDFfile, writeSVGfile +export writeEPSfile, writePDFfile export pyx_fill, pyx_append, pyx_insert, pyx_text +# See also Python3 section at end canvas = pywrap(pyimport("pyx.canvas")) path = pywrap(pyimport("pyx.path")) @@ -88,8 +89,12 @@ function writePDFfile(g::PyObject, args...; kwargs...) return g[:writePDFfile](args...; kwargs...) end -function writeSVGfile(g::PyObject, args...; kwargs...) - return g[:writeSVGfile](args...; kwargs...) +# Some newer features only in recent (Python3) versions of PyX +if PyCall.pyversion > v"3" + export writeSVGfile + function writeSVGfile(g::PyObject, args...; kwargs...) + return g[:writeSVGfile](args...; kwargs...) + end end end # module PyX -- cgit v1.2.3