summaryrefslogtreecommitdiff
path: root/engine/SCons/Variables
diff options
context:
space:
mode:
Diffstat (limited to 'engine/SCons/Variables')
-rw-r--r--engine/SCons/Variables/BoolVariable.py2
-rw-r--r--engine/SCons/Variables/EnumVariable.py2
-rw-r--r--engine/SCons/Variables/ListVariable.py2
-rw-r--r--engine/SCons/Variables/PackageVariable.py2
-rw-r--r--engine/SCons/Variables/PathVariable.py2
-rw-r--r--engine/SCons/Variables/__init__.py9
6 files changed, 12 insertions, 7 deletions
diff --git a/engine/SCons/Variables/BoolVariable.py b/engine/SCons/Variables/BoolVariable.py
index 881a6b4..8e723fe 100644
--- a/engine/SCons/Variables/BoolVariable.py
+++ b/engine/SCons/Variables/BoolVariable.py
@@ -34,7 +34,7 @@ Usage example::
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Variables/BoolVariable.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/BoolVariable.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog"
__all__ = ['BoolVariable',]
diff --git a/engine/SCons/Variables/EnumVariable.py b/engine/SCons/Variables/EnumVariable.py
index b6fc382..fdc7851 100644
--- a/engine/SCons/Variables/EnumVariable.py
+++ b/engine/SCons/Variables/EnumVariable.py
@@ -37,7 +37,7 @@ Usage example::
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Variables/EnumVariable.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/EnumVariable.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog"
__all__ = ['EnumVariable',]
diff --git a/engine/SCons/Variables/ListVariable.py b/engine/SCons/Variables/ListVariable.py
index 8f9a9a8..616d18b 100644
--- a/engine/SCons/Variables/ListVariable.py
+++ b/engine/SCons/Variables/ListVariable.py
@@ -46,7 +46,7 @@ Usage example::
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "src/engine/SCons/Variables/ListVariable.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/ListVariable.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog"
# Known Bug: This should behave like a Set-Type, but does not really,
# since elements can occur twice.
diff --git a/engine/SCons/Variables/PackageVariable.py b/engine/SCons/Variables/PackageVariable.py
index 8e229b7..9a81c6d 100644
--- a/engine/SCons/Variables/PackageVariable.py
+++ b/engine/SCons/Variables/PackageVariable.py
@@ -50,7 +50,7 @@ Usage example:
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Variables/PackageVariable.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/PackageVariable.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog"
__all__ = ['PackageVariable',]
diff --git a/engine/SCons/Variables/PathVariable.py b/engine/SCons/Variables/PathVariable.py
index dc5fcd2..8b01593 100644
--- a/engine/SCons/Variables/PathVariable.py
+++ b/engine/SCons/Variables/PathVariable.py
@@ -67,7 +67,7 @@ Usage example::
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Variables/PathVariable.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/PathVariable.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog"
__all__ = ['PathVariable',]
diff --git a/engine/SCons/Variables/__init__.py b/engine/SCons/Variables/__init__.py
index 784f795..2c48da6 100644
--- a/engine/SCons/Variables/__init__.py
+++ b/engine/SCons/Variables/__init__.py
@@ -26,10 +26,11 @@ customizable variables to an SCons build.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "src/engine/SCons/Variables/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+__revision__ = "src/engine/SCons/Variables/__init__.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog"
import os.path
import sys
+from functools import cmp_to_key
import SCons.Environment
import SCons.Errors
@@ -287,9 +288,13 @@ class Variables(object):
env - an environment that is used to get the current values
of the options.
+ cmp - Either a function as follows: The specific sort function should take two arguments and return -1, 0 or 1
+ or a boolean to indicate if it should be sorted.
"""
- if sort:
+ if callable(sort):
+ options = sorted(self.options, key=cmp_to_key(lambda x,y: sort(x.key,y.key)))
+ elif sort is True:
options = sorted(self.options, key=lambda x: x.key)
else:
options = self.options