Clone of official tools

Revision:
43:2a7da56ebd24
Parent:
40:7d3fa6b99b2b
--- a/settings.py	Mon Nov 06 13:17:14 2017 -0600
+++ b/settings.py	Tue Sep 25 13:43:09 2018 -0500
@@ -14,7 +14,7 @@
 See the License for the specific language governing permissions and
 limitations under the License.
 """
-
+from __future__ import print_function
 from os import getenv
 from os.path import join, abspath, dirname, exists
 import logging
@@ -45,6 +45,7 @@
 # Goanna static analyser. Please overload it in mbed_settings.py
 GOANNA_PATH = ""
 
+
 # cppcheck path (command) and output message format
 CPPCHECK_CMD = ["cppcheck", "--enable=all"]
 CPPCHECK_MSG_FORMAT = ["--template=[{severity}] {file}@{line}: {id}:{message}"]
@@ -54,9 +55,18 @@
 # mbed.org username
 MBED_ORG_USER = ""
 
+# Print compiler warnings and errors as link format
+PRINT_COMPILER_OUTPUT_AS_LINK = False
+
+# Compare against a fixed build of the project for space consumption
+COMPARE_FIXED = False
+
+# Print warnings/errors in color
+COLOR = False
+
 CLI_COLOR_MAP = {
-    "warning": "yellow",
-    "error"  : "red"
+    "Warning": "yellow",
+    "Error"  : "red"
 }
 
 ##############################################################################
@@ -81,7 +91,14 @@
         if exists(getenv('MBED_'+_n)):
             globals()[_n] = getenv('MBED_'+_n)
         else:
-            print "WARNING: MBED_%s set as environment variable but doesn't exist" % _n
+            print("WARNING: MBED_%s set as environment variable but doesn't"
+                  " exist" % _n)
+
+_ENV_VARS = ['PRINT_COMPILER_OUTPUT_AS_LINK', 'COLOR', 'COMPARE_FIXED']
+for _n in _ENV_VARS:
+    value = getenv('MBED_%s' % _n)
+    if value:
+        globals()[_n] = value
 
 
 ##############################################################################