share/rbbt_commands/workflow/prov in rbbt-util-5.22.4 vs share/rbbt_commands/workflow/prov in rbbt-util-5.22.5

- old
+ new

@@ -43,12 +43,14 @@ color = case status.to_sym when :error, :aborted, :missing, :dead :red when :streaming, :started :cyan - when :done, :noinfo + when :done :green + when :noinfo + :blue when :dependencies, :waiting, :setyp :yellow else if status.to_s.index ">" :cyan @@ -58,20 +60,22 @@ end Log.color(color, status.to_s) end def report_msg(status, name, path, info = nil) - parts = path.sub(/\{.*/,'').sub(/#{Regexp.quote(name)}$/,'').split "/" task = Log.color(:yellow, parts.pop) workflow = Log.color(:magenta, parts.pop) + if status.to_s == 'noinfo' and parts.last != 'jobs' + task, status, workflow = Log.color(:yellow, info[:task_name]), Log.color(:blue, "file"), Log.color(:magenta, "-") + end str = if not Open.remote?(path) and (File.exists?(path) and $main_mtime and ($main_mtime - File.mtime(path)) < 0) - status_msg(status.to_s) << " " << [workflow, task, path] * " " << " (#{Log.color(:red, "Mtime out of sync") })" + status_msg(status.to_s) << " " << [workflow, task, path].compact * " " << " (#{Log.color(:red, "Mtime out of sync") })" else - status_msg(status.to_s) << " " << [workflow, task, path] * " " + status_msg(status.to_s) << " " << [workflow, task, path].compact * " " end if $inputs and $inputs.any? job_inputs = Workflow.load_step(path).recursive_inputs.to_hash IndiferentHash.setup(job_inputs) @@ -95,12 +99,13 @@ end str << "\n" end -def report(step, offset = 0) - info = step.info || {} +def report(step, offset = 0, task = nil) + info = step.info || {} + info[:task_name] = task path = step.path status = info[:status] || :missing status = "remote" if Open.remote?(path) name = info[:name] || File.basename(path) status = :unsync if status == :done and not File.exist? path @@ -108,12 +113,12 @@ str << report_msg(status, name, path, info) info[:dependencies].each do |task,name,path| new = ! $seen.include?(path) dep = get_step path if new - str << report(dep, offset + 1) + str << report(dep, offset + 1, task) else - str << Log.color(:blue, Log.uncolor(report(dep, offset+1))) + str << Log.color(:blue, Log.uncolor(report(dep, offset+1, task))) end end if info[:dependencies] str end