Skip to content

Commit 1a7c915

Browse files
committed
added additional info in job printing,
1 parent abc428d commit 1a7c915

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "DFControl"
22
uuid = "1e31e15d-4957-550d-a244-318eced754ae"
33
authors = ["Louis Ponet <[email protected]>"]
44
repo = "https://github.com/louisponet/DFControl.jl.git"
5-
version = "0.3.0"
5+
version = "0.3.1"
66

77
[deps]
88
BinDeps = "9e28174c-4ba2-5203-b857-d8d62c4213ee"

src/display/overloads.jl

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,15 @@ function show(io::IO, job::DFJob)
3737
fns = string.(fieldns)
3838
insert!(fns, 2, "local_dir")
3939
insert!(fs, 2, main_job_dir(job))
40-
push!(fieldns, :available_versions)
41-
push!(fns, join(string.(versions(job)), ", "))
40+
push!(fns, "available versions")
41+
push!(fs, join(string.(versions(job)), ", "))
42+
if haskey(job.metadata, :timestamp)
43+
push!(fns, "last submission")
44+
push!(fs, string(round(job.metadata[:timestamp], Dates.Second)))
45+
end
46+
push!(fns, "running")
47+
is_running = isrunning(job)
48+
push!(fs, string(is_running))
4249
lfns = maximum(length.(fns)) + maximum(length.(fs)) + 4
4350
line = "+"
4451
for i in 1:div(lfns, 2)+1
@@ -69,19 +76,17 @@ function show(io::IO, job::DFJob)
6976
dfprintln(io, crayon"cyan", "|", reset)
7077
end
7178
is = calculations(job)
79+
last = last_running_calculation(job)
7280
if !isempty(is)
7381
dfprintln(io, crayon"cyan", line, reset)
7482
dfprintln(io, reset, "(", crayon"green", "scheduled", reset, ", ", crayon"red",
7583
"not scheduled", reset, ")")
84+
dfprintln(io)
7685
ln = maximum(length.(string.(name.(is))))
7786
for (si, i) in enumerate(is)
7887
n = name(i)
79-
l = length(n)
80-
for j in 1:ln-l
81-
n *= " "
82-
end
8388
cr = i.run ? crayon"green" : crayon"red"
84-
dfprint(io, cr, "\t\t$n\n")
89+
dfprint(io, cr, i == last ? (is_running ? "\t$n <- running\n" : "\t$n <- ran last\n") : "\t$n\n")
8590
end
8691
end
8792
return dfprint(io, reset)

0 commit comments

Comments
 (0)