diff options
| author | Gary Oberbrunner <garyo@oberbrunner.com> | 2013-09-29 19:38:05 (GMT) |
|---|---|---|
| committer | Gary Oberbrunner <garyo@oberbrunner.com> | 2013-09-29 19:38:05 (GMT) |
| commit | 40e8adb05f3a2ef817d3bbd4590991427c5a98a1 (patch) | |
| tree | f765f474641a486d9ae4d398173dac40611b7886 /src/engine | |
| parent | 328e541f40849c270fc75f0932594d18d2e6340b (diff) | |
| parent | 2209d1b9a664b2c33d788311add3f5bf7d6caf8c (diff) | |
| download | SCons-40e8adb05f3a2ef817d3bbd4590991427c5a98a1.zip SCons-40e8adb05f3a2ef817d3bbd4590991427c5a98a1.tar.gz SCons-40e8adb05f3a2ef817d3bbd4590991427c5a98a1.tar.bz2 | |
Merge pull request #80, Literal objects compare for equality
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/SCons/Subst.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/engine/SCons/Subst.py b/src/engine/SCons/Subst.py index 98097dc..318d7d9 100644 --- a/src/engine/SCons/Subst.py +++ b/src/engine/SCons/Subst.py @@ -78,6 +78,14 @@ class Literal(object): def is_literal(self): return 1 + def __eq__(self, other): + if not isinstance(other, Literal): + return False + return self.lstr == other.lstr + + def __neq__(self, other): + return not self.__eq__(other) + class SpecialAttrWrapper(object): """This is a wrapper for what we call a 'Node special attribute.' This is any of the attributes of a Node that we can reference from @@ -172,7 +180,7 @@ class NLWrapper(object): In practice, this might be a wash performance-wise, but it's a little cleaner conceptually... """ - + def __init__(self, list, func): self.list = list self.func = func @@ -190,7 +198,7 @@ class NLWrapper(object): self._create_nodelist = self._return_nodelist return self.nodelist _create_nodelist = _gen_nodelist - + class Targets_or_Sources(collections.UserList): """A class that implements $TARGETS or $SOURCES expansions by in turn @@ -451,7 +459,7 @@ def scons_subst(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={ raise_exception(NameError(key), lvars['TARGETS'], s) else: return '' - + # Before re-expanding the result, handle # recursive expansion by copying the local # variable dictionary and overwriting a null |
