Bug 1296530 - Add a repr() for Option. r?chmanchester draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 13 Oct 2016 12:43:01 +0900
changeset 425028 0b88e295e06e6632c55a8da70c4c7bc31d3c20fb
parent 425020 a15521c1e84ffabb1cbedb6a93e494eb13c99054
child 425029 1b5ed817d31af894e37f61761ecadf315b93e639
push id32321
push userbmo:mh+mozilla@glandium.org
push dateFri, 14 Oct 2016 02:53:47 +0000
reviewerschmanchester
bugs1296530
milestone52.0a1
Bug 1296530 - Add a repr() for Option. r?chmanchester
python/mozbuild/mozbuild/configure/options.py
--- a/python/mozbuild/mozbuild/configure/options.py
+++ b/python/mozbuild/mozbuild/configure/options.py
@@ -365,16 +365,20 @@ class Option(object):
                         "'%s' is not one of %s"
                         % (val, ', '.join("'%s'" % c for c in self.choices)))
 
             if relative_result is not None:
                 values = PositiveOptionValue(relative_result, origin=origin)
 
         return values
 
+    def __repr__(self):
+        return '<%s.%s [%s]>' % (self.__class__.__module__,
+                                 self.__class__.__name__, self.option)
+
 
 class CommandLineHelper(object):
     '''Helper class to handle the various ways options can be given either
     on the command line of through the environment.
 
     For instance, an Option('--foo', env='FOO') can be passed as --foo on the
     command line, or as FOO=1 in the environment *or* on the command line.