Skip to content

Commit

Permalink
Merge pull request #127 from bjarthur/deprecations
Browse files Browse the repository at this point in the history
fix julia 0.5 deprecations
  • Loading branch information
timholy committed Sep 27, 2016
2 parents 69ab458 + ba8f41b commit c44f11b
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 19 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ language: julia
os:
- linux
julia:
- 0.3
- 0.4
- 0.5
- nightly
Expand Down
4 changes: 2 additions & 2 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
julia 0.3
Compat 0.7.16
julia 0.4
Compat 0.7.20
Cairo
Graphics 0.1
BinDeps 0.2.2-
Expand Down
8 changes: 4 additions & 4 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ using Compat; import Compat.String

tcl = library_dependency("tcl",aliases=["libtcl8.6","tcl86g","tcl86t","libtcl","libtcl8.6.so.0","libtcl8.5","libtcl8.5.so.0","tcl85"])
tk = library_dependency("tk",aliases=["libtk8.6","libtk","libtk8.6.so.0","libtk8.5","libtk8.5.so.0","tk85","tk86","tk86t"], depends=[tcl], validate = function(p,h)
@osx_only return @compat Libdl.dlsym_e(h,:TkMacOSXGetRootControl) != C_NULL
is_apple() && (return @compat Libdl.dlsym_e(h,:TkMacOSXGetRootControl) != C_NULL)
return true
end)

@windows_only begin
if is_windows()
using WinRPM
provides(WinRPM.RPM,"tk",tk,os = :Windows)
provides(WinRPM.RPM,"tcl",tcl,os = :Windows)
Expand All @@ -21,12 +21,12 @@ provides(AptGet,"tk8.5",tk)
provides(Sources,URI("http://prdownloads.sourceforge.net/tcl/tcl8.6.0-src.tar.gz"),tcl,unpacked_dir = "tcl8.6.0")
provides(Sources,URI("http://prdownloads.sourceforge.net/tcl/tk8.6.0-src.tar.gz"),tk,unpacked_dir = "tk8.6.0")

is64bit = WORD_SIZE == 64
is64bit = @compat Sys.WORD_SIZE == 64

provides(BuildProcess,Autotools(configure_subdir = "unix", configure_options = [is64bit?"--enable-64bit":"--disable-64bit"]),tcl, os = :Unix)
provides(BuildProcess,Autotools(configure_subdir = "unix", configure_options = [is64bit?"--enable-64bit":"--disable-64bit"]),tk, os = :Unix)

if WORD_SIZE == 64
if @compat Sys.WORD_SIZE == 64
# Unfortunately the mingw-built tc segfaults since some function signatures
# are different between VC and mingw. This is fixed on tcl trunk. For now,
# just use VC to build tcl (Note requlres Visual Studio Express in the PATH)
Expand Down
6 changes: 3 additions & 3 deletions examples/manipulate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function manipulate(ex::(@compat Union{Symbol,Expr}), controls...)

function dict_to_module(d::Dict) ## stuff values into Manipulate Context
for (k,v) in d
eval(ManipulateContext, :($(symbol(k)) = $v))
eval(ManipulateContext, :($(Symbol(k)) = $v))
end
end

Expand Down Expand Up @@ -165,8 +165,8 @@ ex = quote
s = sin(x)
p = FramedPlot()
setattr(p, "title", title)
if
fillbetween add(p, FillBetween(x, c, x, s) )
if fillbetween
add(p, FillBetween(x, c, x, s) )
end
add(p, Curve(x, c, "color", color) )
add(p, Curve(x, s, "color", "blue") )
Expand Down
8 changes: 4 additions & 4 deletions examples/workspace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function update_ids(m::Module)
global __ids__
nms = get_names(m)
nms = filter(u -> u != "__ids__", nms)
a_ids = map(u -> unique_id(symbol(u), m), nms)
a_ids = map(u -> unique_id(Symbol(u), m), nms)
if __ids__ == a_ids
false
else
Expand All @@ -47,9 +47,9 @@ function get_names_summaries(m::Module, pat::MaybeRegex, dtype::MaybeType, dtype
end
## filter out this type
if dtype != nothing
nms = filter(u -> isdefined(m, symbol(u)) && negate(isa(eval(m,symbol(u)), dtype), dtypefilter), nms)
nms = filter(u -> isdefined(m, Symbol(u)) && negate(isa(eval(m,Symbol(u)), dtype), dtypefilter), nms)
end
summaries = map(u -> isdefined(m, symbol(u)) ? short_summary(eval(m,symbol(u))) : "undefined", nms)
summaries = map(u -> isdefined(m, Symbol(u)) ? short_summary(eval(m,Symbol(u))) : "undefined", nms)

if length(nms) == length(summaries)
return [nms summaries]
Expand All @@ -75,7 +75,7 @@ scrollbars_add(f, tv)
## add a callback. Here we get the obj clicked on.
callback_add(tv, (path) -> begin
val = get_value(tv)[1]
obj = eval(Main, symbol(val))
obj = eval(Main, Symbol(val))
println(short_summary(obj))
end)

Expand Down
4 changes: 2 additions & 2 deletions src/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function bindwheel(widget::Widget, modifier::AbstractString, callback::Function,
tkargs = string(" ", tkargs)
end
ccb = tcl_callback(callback)
if OS_NAME == :Linux
if is_linux()
tcl_eval("bind $(path) <$(modifier)Button-4> {$ccb -120$tkargs}")
tcl_eval("bind $(path) <$(modifier)Button-5> {$ccb 120$tkargs}")
else
Expand Down Expand Up @@ -229,7 +229,7 @@ function callback_add(widget::Tk_Widget, callback::Function)
:Tk_Text => "<FocusOut>",
:Tk_Treeview => "<<TreeviewSelect>>"
)
key = Base.symbol(split(string(typeof(widget)), '.')[end])
key = Base.Symbol(split(string(typeof(widget)), '.')[end])
if haskey(events, key)
event = events[key]
if event == nothing
Expand Down
4 changes: 2 additions & 2 deletions src/menu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function menu_add(widget::Tk_Menu, rb::Tk_Radio)
end

function tk_popup(widget::Tk_Widget, menu::Tk_Menu)
if OS_NAME == :Darwin
if is_apple()
tcl_eval("bind $(widget.w.path) <2> {tk_popup $(menu.w.path) %X %Y}")
tcl_eval("bind $(widget.w.path) <Control-1> {tk_popup $(menu.w.path) %X %Y}")
else
Expand All @@ -63,7 +63,7 @@ function tk_popup(widget::Tk_Widget, menu::Tk_Menu)
end

function tk_popup(c::Canvas, menu::Tk_Menu)
if OS_NAME == :Darwin
if is_apple()
tcl_eval("bind $(c.c.path) <2> {tk_popup $(menu.w.path) %X %Y}")
tcl_eval("bind $(c.c.path) <Control-1> {tk_popup $(menu.w.path) %X %Y}")
else
Expand Down
2 changes: 1 addition & 1 deletion src/tkwidget.jl
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ function reveal(c::Canvas)
end

@static if is_apple()
if WORD_SIZE == 32
if @compat Sys.WORD_SIZE == 32
typealias CGFloat Float32
else
typealias CGFloat Float64
Expand Down

0 comments on commit c44f11b

Please sign in to comment.