Skip to content

Commit 387c388

Browse files
committed
0.4 deprecations: Union, UInt, Void, String
1 parent a9468e2 commit 387c388

9 files changed

+54
-54
lines changed

DESIGN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ A type `Element` which represents anything displayable (can use type promotion h
4949
# stack elems in the specified direction (down, right, left, up)
5050
flow(direction :: Symbol, elems :: Element....) # returns an Element
5151
# Create a tab group with a tab for each element
52-
tabs(elems :: (String, Element)...) # returns an Element
52+
tabs(elems :: (AbstractString, Element)...) # returns an Element
5353
# accordion, etc in the same vein
5454
```
5555

REQUIRE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
julia 0.3
22
JSON
3-
Compat
3+
Compat 0.7
44
Reactive 0.1.9
55
DataStructures 0.2.10

doc/notebooks/02-Widgets Overview.ipynb

+6-6
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@
526526
"data": {
527527
"text/html": [],
528528
"text/plain": [
529-
"Button{Nothing}([Input{Nothing}] nothing,\"Click Me\",nothing)"
529+
"Button{Void}([Input{Void}] nothing,\"Click Me\",nothing)"
530530
]
531531
},
532532
"execution_count": 8,
@@ -598,7 +598,7 @@
598598
"data": {
599599
"text/html": [],
600600
"text/plain": [
601-
"Options{:Dropdown,ASCIIString}([Input{ASCIIString}] one,\"\",\"one\",\"one\",OptionDict({\"one\",\"two\",\"three\"},{\"two\"=>\"two\",\"one\"=>\"one\",\"three\"=>\"three\"}),None[],None[])"
601+
"Options{:Dropdown,ASCIIAbstractString}([Input{ASCIIAbstractString}] one,\"\",\"one\",\"one\",OptionDict({\"one\",\"two\",\"three\"},{\"two\"=>\"two\",\"one\"=>\"one\",\"three\"=>\"three\"}),None[],None[])"
602602
]
603603
},
604604
"execution_count": 10,
@@ -757,7 +757,7 @@
757757
"cell_type": "markdown",
758758
"metadata": {},
759759
"source": [
760-
"A textbox can be of a `Number` or `String` type. `textbox` takes one argument: its default value."
760+
"A textbox can be of a `Number` or `AbstractString` type. `textbox` takes one argument: its default value."
761761
]
762762
},
763763
{
@@ -771,7 +771,7 @@
771771
"data": {
772772
"text/html": [],
773773
"text/plain": [
774-
"Textbox{UTF8String}([Input{UTF8String}] Change me,\"\",nothing,\"Change me\")"
774+
"Textbox{UTF8AbstractString}([Input{UTF8AbstractString}] Change me,\"\",nothing,\"Change me\")"
775775
]
776776
},
777777
"execution_count": 16,
@@ -943,7 +943,7 @@
943943
"data": {
944944
"text/html": [],
945945
"text/plain": [
946-
"Textarea{ASCIIString}([Input{ASCIIString}] Your very own $\\LaTeX$ editor,\"\",\"Your very own \\$\\\\LaTeX\\$ editor\")"
946+
"Textarea{ASCIIAbstractString}([Input{ASCIIAbstractString}] Your very own $\\LaTeX$ editor,\"\",\"Your very own \\$\\\\LaTeX\\$ editor\")"
947947
]
948948
},
949949
"execution_count": 22,
@@ -1023,7 +1023,7 @@
10231023
"data": {
10241024
"text/html": [],
10251025
"text/plain": [
1026-
"Textbox{String}([Input{String}] text,\"\",nothing,\"text\")"
1026+
"Textbox{AbstractString}([Input{AbstractString}] text,\"\",nothing,\"text\")"
10271027
]
10281028
},
10291029
"metadata": {},

doc/notebooks/03-Interactive Diagrams and Plots.ipynb

+1-1
Large diffs are not rendered by default.

doc/notebooks/04-Animations.ipynb

+15-15
Large diffs are not rendered by default.

src/IJulia/setup.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import Base: writemime, mimewritable
3535
const comms = Dict{Signal, Comm}()
3636

3737
function get_data_dict(value, mimetypes)
38-
dict = Dict{ASCIIString, ByteString}()
38+
dict = Dict{ASCIIAbstractString, ByteAbstractString}()
3939
for m in mimetypes
4040
if mimewritable(m, value)
4141
dict[m] = stringmime(m, value)
@@ -51,7 +51,7 @@ end
5151

5252
function init_comm(x::Signal)
5353
if !haskey(comms, x)
54-
subscriptions = Dict{ASCIIString, Int}()
54+
subscriptions = Dict{ASCIIAbstractString, Int}()
5555
function handle_subscriptions(msg)
5656
if haskey(msg.content, "data")
5757
action = get(msg.content["data"], "action", "")
@@ -207,7 +207,7 @@ function create_view(w::Widget)
207207
if haskey(widget_comms, w)
208208
comm = widget_comms[w]
209209
else
210-
comm = Comm("ipython.widget", data=merge(Dict{String, Any}([
210+
comm = Comm("ipython.widget", data=merge(Dict{AbstractString, Any}([
211211
("model_name", "WidgetModel"),
212212
("_model_name", "WidgetModel"), # Jupyter 4.0 missing (https://github.com/ipython/ipywidgets/pull/84)
213213
]), view_state(w)))

src/Interact.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ end
4949

5050
uuid4() = string(Base.Random.uuid4())
5151

52-
const id_to_widget = Dict{String, InputWidget}()
53-
const widget_to_id = Dict{InputWidget, String}()
52+
const id_to_widget = Dict{AbstractString, InputWidget}()
53+
const widget_to_id = Dict{InputWidget, AbstractString}()
5454

5555
function register_widget(w::InputWidget)
5656
if haskey(widget_to_id, w)
@@ -63,7 +63,7 @@ function register_widget(w::InputWidget)
6363
end
6464
end
6565

66-
function get_widget(id::String)
66+
function get_widget(id::AbstractString)
6767
if haskey(id_to_widget, id)
6868
return id_to_widget[id]
6969
else

src/compose.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ style(widget, style) = StyledWidget(widget, style)
1313

1414
immutable Labeled{W <: Widget} <: WidgetMod
1515
widget::W
16-
label::String
16+
label::AbstractString
1717
end
1818

1919
label(widget, label) = LabeledWidget(widget, label)

src/widgets.jl

+23-23
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export slider, togglebutton, button,
1111

1212
type Slider{T<:Number} <: InputWidget{T}
1313
signal::Input{T}
14-
label::String
14+
label::AbstractString
1515
value::T
1616
range::Range{T}
1717
end
@@ -30,7 +30,7 @@ slider{T}(range::Range{T};
3030

3131
type Checkbox <: InputWidget{Bool}
3232
signal::Input{Bool}
33-
label::String
33+
label::AbstractString
3434
value::Bool
3535
end
3636

@@ -44,7 +44,7 @@ checkbox(; label="", value=false, signal=Input(value)) =
4444

4545
type ToggleButton <: InputWidget{Bool}
4646
signal::Input{Bool}
47-
label::String
47+
label::AbstractString
4848
value::Bool
4949
end
5050

@@ -60,7 +60,7 @@ togglebutton(label; kwargs...) =
6060

6161
type Button{T} <: InputWidget{T}
6262
signal::Input{T}
63-
label::String
63+
label::AbstractString
6464
value::T
6565
end
6666

@@ -74,14 +74,14 @@ button(label; kwargs...) =
7474

7575
type Textbox{T} <: InputWidget{T}
7676
signal::Input{T}
77-
label::String
78-
range::Union(Nothing, Range)
77+
label::AbstractString
78+
@compat range::Union{Void, Range}
7979
value::T
8080
end
8181

8282
function empty(t::Type)
8383
if is(t, Number) zero(t)
84-
elseif is(t, String) ""
84+
elseif is(t, AbstractString) ""
8585
end
8686
end
8787

@@ -91,7 +91,7 @@ function Textbox(; label="",
9191
typ=typeof(value),
9292
range=nothing,
9393
signal=Input{typ}(value))
94-
if isa(value, String) && !isa(range, Nothing)
94+
if isa(value, AbstractString) && !isa(range, Void)
9595
throw(ArgumentError(
9696
"You cannot set a range on a string textbox"
9797
))
@@ -102,7 +102,7 @@ end
102102
textbox(;kwargs...) = Textbox(;kwargs...)
103103
textbox(val; kwargs...) =
104104
Textbox(value=val; kwargs...)
105-
textbox(val::String; kwargs...) =
105+
textbox(val::AbstractString; kwargs...) =
106106
Textbox(value=utf8(val); kwargs...)
107107

108108
parse_msg{T<:Number}(w::Textbox{T}, val::AbstractString) = parse_msg(w, parse(T, val))
@@ -118,10 +118,10 @@ end
118118

119119
######################### Textarea ###########################
120120

121-
type Textarea{String} <: InputWidget{String}
122-
signal::Input{String}
123-
label::String
124-
value::String
121+
type Textarea{AbstractString} <: InputWidget{AbstractString}
122+
signal::Input{AbstractString}
123+
label::AbstractString
124+
value::AbstractString
125125
end
126126

127127
textarea(args...) = Textarea(args...)
@@ -154,9 +154,9 @@ function Base.setindex!(x::OptionDict, v, k)
154154
end
155155
type Options{view, T} <: InputWidget{T}
156156
signal::Signal
157-
label::String
157+
label::AbstractString
158158
value::T
159-
value_label::String
159+
value_label::AbstractString
160160
options::OptionDict
161161
icons::AbstractArray
162162
tooltips::AbstractArray
@@ -212,8 +212,8 @@ export HTML, Latex, Progress
212212

213213

214214
type HTML <: Widget
215-
label::String
216-
value::String
215+
label::AbstractString
216+
value::AbstractString
217217
end
218218
html(label, value) = HTML(label, value)
219219
html(value; label="") = HTML(label, value)
@@ -223,19 +223,19 @@ html(value; label="") = HTML(label, value)
223223
## write(io, h.value)
224224

225225
type Latex <: Widget
226-
label::String
227-
value::String
226+
label::AbstractString
227+
value::AbstractString
228228
end
229-
latex(label, value::String) = Latex(label, value)
230-
latex(value::String; label="") = Latex(label, value)
229+
latex(label, value::AbstractString) = Latex(label, value)
230+
latex(value::AbstractString; label="") = Latex(label, value)
231231
latex(value; label="") = Latex(label, mimewritable("application/x-latex", value) ? stringmime("application/x-latex", value) : stringmime("text/latex", value))
232232

233233
## # assume we already have Latex
234234
## writemime(io::IO, m::MIME{symbol("application/x-latex")}, l::Latex) =
235235
## write(io, l.value)
236236

237237
type Progress <: Widget
238-
label::String
238+
label::AbstractString
239239
value::Int
240240
range::Range
241241
end
@@ -251,5 +251,5 @@ widget(x::Range, label="") = slider(x, label=label)
251251
widget(x::AbstractVector, label="") = togglebuttons(x, label=label)
252252
widget(x::Associative, label="") = togglebuttons(x, label=label)
253253
widget(x::Bool, label="") = checkbox(x, label=label)
254-
widget(x::String, label="") = textbox(x, label=label, typ=String)
254+
widget(x::AbstractString, label="") = textbox(x, label=label, typ=AbstractString)
255255
widget{T <: Number}(x::T, label="") = textbox(typ=T, value=x, label=label)

0 commit comments

Comments
 (0)