summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Util.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2007-01-21 20:13:49 (GMT)
committerSteven Knight <knight@baldmt.com>2007-01-21 20:13:49 (GMT)
commit373a4788e2959fea72a6d5875bb8b59f04339961 (patch)
tree2da695bd6cd3956319741b8d251129cbe51fab22 /src/engine/SCons/Util.py
parent75e1b1228eeefa79a360e6056365d74a5d39ce65 (diff)
downloadSCons-373a4788e2959fea72a6d5875bb8b59f04339961.zip
SCons-373a4788e2959fea72a6d5875bb8b59f04339961.tar.gz
SCons-373a4788e2959fea72a6d5875bb8b59f04339961.tar.bz2
Merged revisions 1767-1783 via svnmerge from
http://scons.tigris.org/svn/scons/branches/core ........ r1771 | stevenknight | 2007-01-11 10:42:17 -0600 (Thu, 11 Jan 2007) | 1 line 0.96.D544 - Fix maximum recursion depth exceeded when writing .sconsign files after using Nodes on two different Windows drive letters. ........ r1772 | stevenknight | 2007-01-11 12:15:07 -0600 (Thu, 11 Jan 2007) | 1 line 0.96.D545 - Restore caching of file contents in Node.FS.File.get_contents(). ........ r1773 | stevenknight | 2007-01-12 10:22:40 -0600 (Fri, 12 Jan 2007) | 1 line 0.96.D405 - Add MergeFlags() and AddFlags() methods. (Greg Noel) Support recognizing compiler flags that begin with +. (Kent Boortz) ........ r1774 | stevenknight | 2007-01-16 15:58:39 -0600 (Tue, 16 Jan 2007) | 2 lines Back out previous modification; the wrong change was distributed. ........ r1775 | stevenknight | 2007-01-16 16:08:26 -0600 (Tue, 16 Jan 2007) | 1 line 0.96.D546 - Back out previous change that cached get_contents(). ........ r1776 | stevenknight | 2007-01-17 14:30:59 -0600 (Wed, 17 Jan 2007) | 1 line 0.96.D547 - Document the use of ${} to evaluate arbitrary Python code. (Gary Oberbrunner) ........ r1777 | stevenknight | 2007-01-17 15:43:18 -0600 (Wed, 17 Jan 2007) | 1 line 0.96.D548 - Better man page Scanner example (Matt Doar); add FindPathDirs() to the publicly-available functions, and document it. ........ r1778 | stevenknight | 2007-01-17 17:01:03 -0600 (Wed, 17 Jan 2007) | 1 line 0.96.D549 - Return MSVC default paths for versions >= 8.0. (Anonymous) ........ r1779 | stevenknight | 2007-01-18 08:37:58 -0600 (Thu, 18 Jan 2007) | 1 line 0.96.D550 - Windows fix for the rel_path() unit test. ........ r1780 | stevenknight | 2007-01-18 14:01:32 -0600 (Thu, 18 Jan 2007) | 1 line 0.96.D551 - Fix use of __builtins__ in Subst.py. ........ r1781 | stevenknight | 2007-01-18 16:00:27 -0600 (Thu, 18 Jan 2007) | 1 line 0.96.D552 - Collect compatibility code in its own SCons.compat subpackage. ........ r1782 | stevenknight | 2007-01-18 16:22:52 -0600 (Thu, 18 Jan 2007) | 1 line 0.96.D553 - Add the vanilla Python 2.5 subprocess.py module (currently unused) as a baseline for our backwards-compatibility changes to that module. ........ r1783 | stevenknight | 2007-01-18 17:09:39 -0600 (Thu, 18 Jan 2007) | 1 line 0.96.D554 - Change env.ParseConfig() to use the new subprocess module. ........
Diffstat (limited to 'src/engine/SCons/Util.py')
-rw-r--r--src/engine/SCons/Util.py66
1 files changed, 3 insertions, 63 deletions
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py
index d673d22..4bd050a 100644
--- a/src/engine/SCons/Util.py
+++ b/src/engine/SCons/Util.py
@@ -29,7 +29,8 @@ Various utility functions go here.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import __builtin__
+import SCons.compat
+
import copy
import os
import os.path
@@ -41,6 +42,7 @@ import types
from UserDict import UserDict
from UserList import UserList
+from UserString import UserString
# Don't "from types import ..." these because we need to get at the
# types module later to look for UnicodeType.
@@ -50,68 +52,6 @@ ListType = types.ListType
StringType = types.StringType
TupleType = types.TupleType
-try:
- from UserString import UserString
-except ImportError:
- # "Borrowed" from the Python 2.2 UserString module
- # and modified slightly for use with SCons.
- class UserString:
- def __init__(self, seq):
- if is_String(seq):
- self.data = seq
- elif isinstance(seq, UserString):
- self.data = seq.data[:]
- else:
- self.data = str(seq)
- def __str__(self): return str(self.data)
- def __repr__(self): return repr(self.data)
- def __int__(self): return int(self.data)
- def __long__(self): return long(self.data)
- def __float__(self): return float(self.data)
- def __complex__(self): return complex(self.data)
- def __hash__(self): return hash(self.data)
-
- def __cmp__(self, string):
- if isinstance(string, UserString):
- return cmp(self.data, string.data)
- else:
- return cmp(self.data, string)
- def __contains__(self, char):
- return char in self.data
-
- def __len__(self): return len(self.data)
- def __getitem__(self, index): return self.__class__(self.data[index])
- def __getslice__(self, start, end):
- start = max(start, 0); end = max(end, 0)
- return self.__class__(self.data[start:end])
-
- def __add__(self, other):
- if isinstance(other, UserString):
- return self.__class__(self.data + other.data)
- elif is_String(other):
- return self.__class__(self.data + other)
- else:
- return self.__class__(self.data + str(other))
- def __radd__(self, other):
- if is_String(other):
- return self.__class__(other + self.data)
- else:
- return self.__class__(str(other) + self.data)
- def __mul__(self, n):
- return self.__class__(self.data*n)
- __rmul__ = __mul__
-
-#
-try:
- __builtin__.zip
-except AttributeError:
- def zip(*lists):
- result = []
- for i in xrange(len(lists[0])):
- result.append(tuple(map(lambda l, i=i: l[i], lists)))
- return result
- __builtin__.zip = zip
-
_altsep = os.altsep
if _altsep is None and sys.platform == 'win32':
# My ActivePython 2.0.1 doesn't set os.altsep! What gives?