[Pkg-debile-commits] [debile-web] 10/16: better formatting of the timing

Sylvestre Ledru sylvestre at alioth.debian.org
Thu Aug 29 10:11:09 UTC 2013


This is an automated email from the git hooks/post-receive script.

sylvestre pushed a commit to branch update-usuability
in repository debile-web.

commit f89b670023165f49db2940d68883847af4a48366
Author: Sylvestre Ledru <sylvestre at debian.org>
Date:   Wed Aug 28 15:56:11 2013 +0200

    better formatting of the timing
---
 debileweb/blueprints/frontend.py |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/debileweb/blueprints/frontend.py b/debileweb/blueprints/frontend.py
index 966fa95..9b1afa2 100644
--- a/debileweb/blueprints/frontend.py
+++ b/debileweb/blueprints/frontend.py
@@ -332,7 +332,11 @@ def report(job_id):
 
     job_info = {}
     job_info['job'] = job
-    job_info['job_runtime'] = job.finished_at - job.assigned_at
+    time_diff = job.finished_at - job.assigned_at
+    hours, remainder = divmod(time_diff.total_seconds(), 3600)
+    minutes, seconds = divmod(remainder, 60)
+    job_info['job_runtime'] = '%d:%02d:%02d' % (hours, minutes, seconds)
+    job_info['job_runtime_type'] = type(job.finished_at - job.assigned_at)
     job_info['machine_link'] = "/machine/%s" % job.machine.name
     if job.package.type == "source":
         job_info['package_link'] = '/source/%s/%s/%s/%s' % (job.package.user.login, job.package.name, job.package.version, job.package.run)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-debile/debile-web.git



More information about the Pkg-debile-commits mailing list