Skip to content

Commit

Permalink
added additional info in job printing,
Browse files Browse the repository at this point in the history
  • Loading branch information
louisponet committed Jun 22, 2021
1 parent abc428d commit 1a7c915
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "DFControl"
uuid = "1e31e15d-4957-550d-a244-318eced754ae"
authors = ["Louis Ponet <[email protected]>"]
repo = "https://github.com/louisponet/DFControl.jl.git"
version = "0.3.0"
version = "0.3.1"

[deps]
BinDeps = "9e28174c-4ba2-5203-b857-d8d62c4213ee"
Expand Down
19 changes: 12 additions & 7 deletions src/display/overloads.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,15 @@ function show(io::IO, job::DFJob)
fns = string.(fieldns)
insert!(fns, 2, "local_dir")
insert!(fs, 2, main_job_dir(job))
push!(fieldns, :available_versions)
push!(fns, join(string.(versions(job)), ", "))
push!(fns, "available versions")
push!(fs, join(string.(versions(job)), ", "))
if haskey(job.metadata, :timestamp)
push!(fns, "last submission")
push!(fs, string(round(job.metadata[:timestamp], Dates.Second)))
end
push!(fns, "running")
is_running = isrunning(job)
push!(fs, string(is_running))
lfns = maximum(length.(fns)) + maximum(length.(fs)) + 4
line = "+"
for i in 1:div(lfns, 2)+1
Expand Down Expand Up @@ -69,19 +76,17 @@ function show(io::IO, job::DFJob)
dfprintln(io, crayon"cyan", "|", reset)
end
is = calculations(job)
last = last_running_calculation(job)
if !isempty(is)
dfprintln(io, crayon"cyan", line, reset)
dfprintln(io, reset, "(", crayon"green", "scheduled", reset, ", ", crayon"red",
"not scheduled", reset, ")")
dfprintln(io)
ln = maximum(length.(string.(name.(is))))
for (si, i) in enumerate(is)
n = name(i)
l = length(n)
for j in 1:ln-l
n *= " "
end
cr = i.run ? crayon"green" : crayon"red"
dfprint(io, cr, "\t\t$n\n")
dfprint(io, cr, i == last ? (is_running ? "\t$n <- running\n" : "\t$n <- ran last\n") : "\t$n\n")
end
end
return dfprint(io, reset)
Expand Down

2 comments on commit 1a7c915

@louisponet
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/39436

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.1 -m "<description of version>" 1a7c9156ebf8384209607199008da8668f9c8f16
git push origin v0.3.1

Please sign in to comment.