Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modified: src/progress.jl #257

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/progress.jl
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ mutable struct ProgressBar
paused::Bool
task::Union{Task,Nothing}
renderstatus::Any
extra_info::Union{Dict{String,<:Any},Nothing}
extra_info::Dict{String,<:Any}
end

"""
Expand All @@ -286,7 +286,7 @@ end
RGBColor("(.05, 1, .05)"),
],
refresh_rate::Int = 60, # FPS of rendering
extra_info::Union{Dict{String,<:Any},Nothing} = nothing,
extra_info::Dict{String,<:Any} = Dict{String,Any}(),
)

Create a ProgressBar instance.
Expand All @@ -299,7 +299,7 @@ function ProgressBar(;
transient::Bool = false,
colors::Union{String,Vector{RGBColor}} = [RGBColor("(1, .05, .05)"), RGBColor("(.05, .05, 1)"), RGBColor("(.05, 1, .05)")],
refresh_rate::Int = 60, # FPS of rendering
extra_info::Union{Dict{String,<:Any},Nothing} = nothing,
extra_info::Dict{String,<:Any} = Dict{String,Any}(),
)
columns = columns isa Symbol ? get_columns(columns) : columns

Expand Down Expand Up @@ -530,7 +530,7 @@ function render(pbar::ProgressBar)
end

# render the extra information
if !isnothing(pbar.extra_info)
if !isempty(pbar.extra_info)
max_len = maximum(length.(keys(pbar.extra_info)))
for (k, v) in pbar.extra_info
write(iob, "\n" * k * " "^(max_len - length(k)) * " : " * string(v))
Expand Down
Loading