Skip to content

Commit 985333d

Browse files
committed
Convert the one and two argument show methods to MIME"text/plain" methods
1 parent 9a5854f commit 985333d

File tree

4 files changed

+82
-141
lines changed

4 files changed

+82
-141
lines changed

src/abstractdataframe/io.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ Base.show(io::IO, mime::MIME"text/csv", df::AbstractDataFrame) =
147147
printtable(io, df, header = true, separator = ',')
148148
Base.show(io::IO, mime::MIME"text/tab-separated-values", df::AbstractDataFrame) =
149149
printtable(io, df, header = true, separator = '\t')
150-
Base.show(io::IO, mime::MIME"text/plain", df::AbstractDataFrame; kwargs...) =
151-
show(io, df; kwargs...)
152150

153151
##############################################################################
154152
#

src/abstractdataframe/show.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,9 @@ else
409409
end
410410

411411
"""
412-
show([io::IO, ]df::AbstractDataFrame;
412+
show([io::IO, ],
413+
::MIME"text/plain",
414+
df::AbstractDataFrame;
413415
allrows::Bool = !get(io, :limit, false),
414416
allcols::Bool = !get(io, :limit, false),
415417
allgroups::Bool = !get(io, :limit, false),
@@ -464,6 +466,7 @@ julia> show(df, row_labels=nothing)
464466
```
465467
"""
466468
function Base.show(io::IO,
469+
::MIME"text/plain",
467470
df::AbstractDataFrame;
468471
allrows::Bool = !get(io, :limit, false),
469472
allcols::Bool = !get(io, :limit, false),
@@ -480,15 +483,16 @@ function Base.show(io::IO,
480483
summary=summary, eltypes=eltypes, truncate=truncate, kwargs...)
481484
end
482485

483-
Base.show(df::AbstractDataFrame;
486+
Base.show(::MIME"text/plain",
487+
df::AbstractDataFrame;
484488
allrows::Bool = !get(stdout, :limit, true),
485489
allcols::Bool = !get(stdout, :limit, true),
486490
rowlabel::Symbol = :Row,
487491
summary::Bool = true,
488492
eltypes::Bool = true,
489493
truncate::Int = 32,
490494
kwargs...) =
491-
show(stdout, df;
495+
show(stdout, MIME("text/plain"), df;
492496
allrows=allrows, allcols=allcols, rowlabel=rowlabel, summary=summary,
493497
eltypes=eltypes, truncate=truncate, kwargs...)
494498

src/groupeddataframe/show.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function Base.summary(io::IO, gd::GroupedDataFrame)
66
join(io, groupcols(gd), ", ")
77
end
88

9-
function Base.show(io::IO, gd::GroupedDataFrame;
9+
function Base.show(io::IO, ::MIME"text/plain", gd::GroupedDataFrame;
1010
allgroups::Bool = !get(io, :limit, false),
1111
allrows::Bool = !get(io, :limit, false),
1212
allcols::Bool = !get(io, :limit, false),
@@ -33,7 +33,7 @@ function Base.show(io::IO, gd::GroupedDataFrame;
3333
join(io, identified_groups, ", ")
3434
println(io)
3535

36-
show(io, gd[i]; summary=false,
36+
show(io, MIME("text/plain"), gd[i]; summary=false,
3737
allrows=allrows, allcols=allcols, rowlabel=rowlabel,
3838
truncate=truncate, kwargs...)
3939
end
@@ -90,7 +90,7 @@ function Base.show(io::IO, gd::GroupedDataFrame;
9090
join(io, identified_groups, ", ")
9191
println(io)
9292

93-
show(io, gd[1]; summary=false,
93+
show(io, MIME("text/plain"), gd[1]; summary=false,
9494
allrows=allrows, allcols=allcols, rowlabel=rowlabel,
9595
truncate=truncate, display_size=(h1, w), kwargs...)
9696

@@ -106,7 +106,7 @@ function Base.show(io::IO, gd::GroupedDataFrame;
106106
join(io, identified_groups, ", ")
107107
println(io)
108108

109-
show(io, gd[N]; summary=false,
109+
show(io, MIME("text/plain"), gd[N]; summary=false,
110110
allrows=allrows, allcols=allcols, rowlabel=rowlabel,
111111
truncate=truncate, display_size=(h2, w), kwargs...)
112112
end

0 commit comments

Comments
 (0)