aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-02-19 05:41:38 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-02-19 23:13:32 +0530
commitf1fe823763bf0b9b7320639e918ab32b56065145 (patch)
tree2ac91b5ca98d01cc12e5cf92a0b33f22a621c4a0
parente9f9a42c7a5346f2f0e77b0dc8a73b4c4b1b2bc5 (diff)
downloadmeson-f1fe823763bf0b9b7320639e918ab32b56065145.zip
meson-f1fe823763bf0b9b7320639e918ab32b56065145.tar.gz
meson-f1fe823763bf0b9b7320639e918ab32b56065145.tar.bz2
Add repr() for EnvironmentVariables{,Holder}
Makes it easier to debug issues with it
-rw-r--r--mesonbuild/build.py4
-rw-r--r--mesonbuild/interpreter.py4
2 files changed, 8 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 5f2de3b..7ab656e 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -227,6 +227,10 @@ class EnvironmentVariables:
def __init__(self):
self.envvars = []
+ def __repr__(self):
+ repr_str = "<{0}: {1}>"
+ return repr_str.format(self.__class__.__name__, self.envvars)
+
def get_value(self, name, values, kwargs):
separator = kwargs.get('separator', os.pathsep)
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index f6065d5..020f84c 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -134,6 +134,10 @@ class EnvironmentVariablesHolder(MutableInterpreterObject):
'prepend': self.prepend_method,
})
+ def __repr__(self):
+ repr_str = "<{0}: {1}>"
+ return repr_str.format(self.__class__.__name__, self.held_object.envvars)
+
@stringArgs
def add_var(self, method, args, kwargs):
if not isinstance(kwargs.get("separator", ""), str):