From 3a51a710146de937be349d037182875a09fa42f7 Mon Sep 17 00:00:00 2001 From: nojhan Date: Tue, 26 Mar 2013 23:38:16 +0100 Subject: [PATCH] More harmonious cmake/g++ themes CMake theme less colorful, in cyan/green, color errors. Better g++ messages parsing. --- colout_cmake.py | 38 ++++++++++++++++++++++++++++++++------ colout_g++.py | 12 +++++++----- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/colout_cmake.py b/colout_cmake.py index 01d74d2..effa04a 100644 --- a/colout_cmake.py +++ b/colout_cmake.py @@ -1,16 +1,42 @@ def theme(): + # CMake theme: + # actions performing in cyan + performing="cyan" + # actions performed in green + performed="green" + th = [ + # Configure... + [ "^--.*works", performed ], + [ "^--.*done", performed ], + [ "^-- Found.*NO", "red" ], + [ "^-- Found.*", performed ], + [ "^--.*broken", "red" ], + [ "^-- Coult NOT find.*", "red" ], + [ "^-- Configuring incomplete, errors occurred!", "red" ], + [ "^--.*", performing ], + # Errors + [ "CMake Error:", "red" ], + [ "CMake Warning", "yellow" ], + # Scan [ "^(Scanning dependencies of target)(.*)$", - "magenta,blue", "normal,bold" ], - [ "^(Linking \w+ \w+ library)(\s.*/)(\w+.[aso]+)$", - "magenta", "normal,normal,bold" ], + performing, "normal,bold" ], + # Link + [ "^(Linking .* (library|executable) )(.*/)+(.+(\.[aso]+)*)$", + performing, "normal,normal,bold" ], + # [percent] Built [ "^\[\s*[0-9]+%\]\s(Built target)(\s.*)$", - "cyan,blue", "normal,bold" ], - [ "^\[\s*[0-9]+%\]\s(Building \w* object)(\s.*/)(\w+.cpp)(.o)$", - "green", "normal,normal,bold,normal"] + performed, "normal,bold" ], + # [percent] Building + [ "^\[\s*[0-9]+%\]\s(Building \w* object)(\s.*/)(\w+.c.*)(.o)$", + performing, "normal,normal,bold,normal"], + # make errors + [ "make\[[0-9]+\].*", "yellow"], + [ "(make:.*)(Error [0-9]+)", "red", "normal,bold"] ] + # Percentages: rainbow from magenta to red, depending on the number percs={ "\s":("magenta","normal"), "1":("magenta","normal"), diff --git a/colout_g++.py b/colout_g++.py index 048afe0..6e9c5a8 100644 --- a/colout_g++.py +++ b/colout_g++.py @@ -1,12 +1,14 @@ def theme(): return [ - [ "error", "red", "bold" ], + [ "(fatal )*(error)", "red", "bold" ], [ "warning", "magenta", "bold" ], - [ "\[-W.*\]", "magenta", "normal" ], [ "note", "blue", "bold" ], - [ ":([0-9]+):[0-9]*", "yellow", "normal" ], - [ "^((/\w+)+)\.(h|cpp)", "white", "normal" ], - [ "'(.*)'", "Cpp", "monokai" ], + # [-Wflag] + [ "\[-W.*\]", "magenta"], + # Filename:line number + [ "(/.*?)/([^/]+\.)(h|cp*):([0-9]+):*[0-9]*(.*)", "white,white,white,yellow,none", "normal,bold,bold,normal"], + # source code in single quotes + [ "'(.*)'", "Cpp", "monokai" ] ]