[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible: fixup previous commit

Mattia Rizzolo gitlab at salsa.debian.org
Tue May 15 19:47:44 BST 2018


Mattia Rizzolo pushed to branch master at Debian QA / jenkins.debian.net


Commits:
6b82fdc6 by Mattia Rizzolo at 2018-05-15T20:47:22+02:00
reproducible: fixup previous commit

Signed-off-by: Mattia Rizzolo <mattia at debian.org>

- - - - -


1 changed file:

- bin/reproducible_common.py


Changes:

=====================================
bin/reproducible_common.py
=====================================
--- a/bin/reproducible_common.py
+++ b/bin/reproducible_common.py
@@ -266,16 +266,13 @@ def create_temp_file(mode='w+b'):
 
 
 class bcolors:
-    @staticmethod
-    def __if_a_tty(colorcode):
-        return colorcode if sys.stdout.isatty() else ''
-    BOLD = __if_a_tty('\033[1m')
-    UNDERLINE = __if_a_tty('\033[4m')
-    RED = __if_a_tty('\033[91m')
-    GOOD = __if_a_tty('\033[92m')
-    WARN = __if_a_tty('\033[93m' + UNDERLINE)
-    FAIL = __if_a_tty(RED + BOLD + UNDERLINE)
-    ENDC = __if_a_tty('\033[0m')
+    BOLD = '\033[1m' if sys.stdout.isatty() else ''
+    UNDERLINE = '\033[4m' if sys.stdout.isatty() else ''
+    RED = '\033[91m' if sys.stdout.isatty() else ''
+    GOOD = '\033[92m' if sys.stdout.isatty() else ''
+    WARN = '\033[93m' + UNDERLINE if sys.stdout.isatty() else ''
+    FAIL = RED + BOLD + UNDERLINE
+    ENDC = '\033[0m' if sys.stdout.isatty() else ''
 
 
 def convert_into_hms_string(duration):



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/6b82fdc6ed653fa1fd384196578e2b11328a8bd6

---
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/6b82fdc6ed653fa1fd384196578e2b11328a8bd6
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20180515/4d8da3d0/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list