From b8532be9c879dbebd80b89fd217a50f75bb6462e Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Tue, 22 Aug 2017 05:04:06 -0500 Subject: [PATCH 1/2] Don't launch ProfileGtk if there is no display available Fixes #84 --- src/ProfileView.jl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ProfileView.jl b/src/ProfileView.jl index c6c7aa4..7466e63 100644 --- a/src/ProfileView.jl +++ b/src/ProfileView.jl @@ -35,9 +35,15 @@ const colors = distinguishable_colors(13, [bkg,fontcolor,gccolor], cchoices=Float64[0, 50, 60, 70], hchoices=linspace(0, 330, 24))[4:end] +function have_display() + !is_unix() && return true + is_apple() && return true + return haskey(ENV, "DISPLAY") +end + function __init__() push!(LOAD_PATH, splitdir(@__FILE__)[1]) - if isdefined(Main, :IJulia) && !isdefined(Main, :PROFILEVIEW_USEGTK) + if (isdefined(Main, :IJulia) && !isdefined(Main, :PROFILEVIEW_USEGTK)) || !have_display() eval(Expr(:import, :ProfileViewSVG)) @eval begin view(data = Profile.fetch(); C = false, lidict = nothing, colorgc = true, fontsize = 12, combine = true, pruned = []) = ProfileViewSVG.view(data; C=C, lidict=lidict, colorgc=colorgc, fontsize=fontsize, combine=combine, pruned=pruned) From 7b5f2dca623fc4a63ed8fc9d9fe63e804180d84c Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Tue, 22 Aug 2017 05:49:22 -0500 Subject: [PATCH 2/2] Add 0.6 to the testing matrix --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index e7e7f4b..abc5220 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ os: - linux julia: - 0.5 + - 0.6 - nightly notifications: email: false