Skip to content
This repository has been archived by the owner on Oct 21, 2021. It is now read-only.

Commit

Permalink
Merge pull request #203 from brian-j-smith/master
Browse files Browse the repository at this point in the history
Julia 0.4 compatibility updates.
  • Loading branch information
mlubin committed Sep 25, 2015
2 parents f9452c7 + d2da2f2 commit 04b198d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/common.jl
Expand Up @@ -22,14 +22,14 @@ type ExVertex
label::UTF8String
attributes::AttributeDict

ExVertex(i::Int, label::String) = new(i, label, AttributeDict())
ExVertex(i::Int, label::AbstractString) = new(i, label, AttributeDict())
end

make_vertex(g::AbstractGraph{ExVertex}, label::String) = ExVertex(num_vertices(g) + 1, utf8(label))
make_vertex(g::AbstractGraph{ExVertex}, label::AbstractString) = ExVertex(num_vertices(g) + 1, utf8(label))
vertex_index(v::ExVertex) = v.index
attributes(v::ExVertex, g::AbstractGraph) = v.attributes

typealias ProvidedVertexType Union(KeyVertex, ExVertex)
typealias ProvidedVertexType @compat(Union{KeyVertex, ExVertex})

vertex_index{V<:ProvidedVertexType}(v::V, g::AbstractGraph{V}) = vertex_index(v)

Expand Down
4 changes: 2 additions & 2 deletions src/dot.jl
Expand Up @@ -4,7 +4,7 @@
# http://www.graphviz.org/pub/scm/graphviz2/doc/info/lang.html

# Write the dot representation of a graph to a file by name.
function to_dot(graph::AbstractGraph, filename::String,attrs::AttributeDict=AttributeDict())
function to_dot(graph::AbstractGraph, filename::AbstractString, attrs::AttributeDict=AttributeDict())
open(filename,"w") do f
to_dot(graph, f, attrs)
end
Expand Down Expand Up @@ -75,7 +75,7 @@ function to_dot_graph(attrs::AttributeDict)
end
end

to_dot(attr::String, value) = "\"$attr\"=\"$value\""
to_dot(attr::AbstractString, value) = "\"$attr\"=\"$value\""

to_dot(attr_tuple::@compat Tuple{UTF8String, Any}) = "\"$(attr_tuple[1])\"=\"$(attr_tuple[2])\""

Expand Down
2 changes: 1 addition & 1 deletion src/show.jl
Expand Up @@ -8,7 +8,7 @@ function show(io::IO, v::ExVertex)
end
end

function show(io::IO, e::Union(Edge, ExEdge))
function show(io::IO, e::@compat(Union{Edge, ExEdge}))
print(io, "edge [$(e.index)]: $(e.source) -- $(e.target)")
end

Expand Down

0 comments on commit 04b198d

Please sign in to comment.