]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Display specified modules in bold.
authorCollin Funk <collin.funk1@gmail.com>
Fri, 29 Mar 2024 13:09:20 +0000 (06:09 -0700)
committerBruno Haible <bruno@clisp.org>
Fri, 29 Mar 2024 14:11:08 +0000 (15:11 +0100)
* pygnulib/GLImport.py (GLImport.prepare): Detect terminals starting
with 'xterm'. Change hexadecimal numbers to octal, matching
gnulib-tool.sh.
* pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.

ChangeLog
pygnulib/GLImport.py
pygnulib/GLTestDir.py

index 72bb1819fed76a2a7d8af5f341354a4ff9149e04..931322915b6de7296e753b08b5116dfde5b1b01c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-03-29  Collin Funk  <collin.funk1@gmail.com>
+
+       gnulib-tool.py: Display specified modules in bold.
+       * pygnulib/GLImport.py (GLImport.prepare): Detect terminals starting
+       with 'xterm'. Change hexadecimal numbers to octal, matching
+       gnulib-tool.sh.
+       * pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.
+
 2024-03-29  Bruno Haible  <bruno@clisp.org>
 
        attribute: Work around compiler bug of Oracle cc 12.6.
index afe751dbd3642729ec7ac177d20ba4540c3b791c..84e1c08689b9e0761b4e59c731aa54ebc551cb2c 100644 (file)
@@ -849,10 +849,10 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix
         if verbose >= 0:
             bold_on = ''
             bold_off = ''
-            term = os.getenv('TERM')
-            if term == 'xterm':
-                bold_on = '\x1b[1m'
-                bold_off = '\x1b[0m'
+            term = os.getenv('TERM', '')
+            if term.startswith('xterm') and os.isatty(1):
+                bold_on = '\033[1m'
+                bold_off = '\033[0m'
             print('Module list with included dependencies (indented):')
             for module in final_modules:
                 if str(module) in self.config.getModules():
index 57fbef7b0640e17a1663ed56b30974b77f393c2d..e395090b83a5a17ff0cb36e2b3ac17535c8a86a4 100644 (file)
@@ -260,10 +260,10 @@ class GLTestDir(object):
         if verbose >= 0:
             bold_on = ''
             bold_off = ''
-            term = os.getenv('TERM')
-            if term == 'xterm':
-                bold_on = '\x1b[1m'
-                bold_off = '\x1b[0m'
+            term = os.getenv('TERM', '')
+            if term.startswith('xterm') and os.isatty(1):
+                bold_on = '\033[1m'
+                bold_off = '\033[0m'
             print('Module list with included dependencies (indented):')
             specified_modules_set = { str(module)
                                       for module in specified_modules }