[Qa-jenkins-scm] [jenkins.debian.net] 01/08: reproducible: move convert_into_hms_string() from _html_live_status to _common

Holger Levsen holger at moszumanska.debian.org
Fri Oct 9 16:03:57 UTC 2015


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

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 806ad46a59e4f8b1b889b66682cedb016f6fe323
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Fri Oct 9 14:03:19 2015 +0000

    reproducible: move convert_into_hms_string() from _html_live_status to _common
---
 bin/reproducible_common.py           | 18 ++++++++++++++++++
 bin/reproducible_html_live_status.py | 16 ----------------
 2 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py
index 3ef21cd..344cdc1 100755
--- a/bin/reproducible_common.py
+++ b/bin/reproducible_common.py
@@ -256,6 +256,24 @@ class bcolors:
     ENDC = '\033[0m'
 
 
+def convert_into_hms_string(duration):
+    if not duration:
+        duration = ''
+    else:
+        duration = int(duration)
+        hours = int(duration/3600)
+        minutes = int((duration-(hours*3600))/60)
+        seconds = int(duration-(hours*3600)-(minutes*60))
+        duration = ''
+        if hours > 0:
+            duration = str(hours)+'h ' + str(minutes)+'m ' + str(seconds) + 's'
+        elif minutes > 0:
+            duration = str(minutes)+'m ' + str(seconds) + 's'
+        else:
+            duration = str(seconds)+'s'
+    return duration
+
+
 def _gen_links(suite, arch):
     links = [
         ('last_24h', '<li><a href="/{suite}/{arch}/index_last_24h.html">packages tested in the last 24h</a></li>'),
diff --git a/bin/reproducible_html_live_status.py b/bin/reproducible_html_live_status.py
index 685fb97..fbb78a1 100755
--- a/bin/reproducible_html_live_status.py
+++ b/bin/reproducible_html_live_status.py
@@ -11,22 +11,6 @@
 from reproducible_common import *
 from reproducible_html_indexes import build_leading_text_section
 
-def convert_into_hms_string(duration):
-    if not duration:
-        duration = ''
-    else:
-        duration = int(duration)
-        hours = int(duration/3600)
-        minutes = int((duration-(hours*3600))/60)
-        seconds = int(duration-(hours*3600)-(minutes*60))
-        duration = ''
-        if hours > 0:
-            duration = str(hours)+'h ' + str(minutes)+'m ' + str(seconds) + 's'
-        elif minutes > 0:
-            duration = str(minutes)+'m ' + str(seconds) + 's'
-        else:
-            duration = str(seconds)+'s'
-    return duration
 
 def generate_schedule(arch):
     """ the schedule pages are very different than others index pages """

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list