OLD | NEW |
1 # | 1 # |
2 # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundat
ion | 2 # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundat
ion |
3 # | 3 # |
4 # Permission is hereby granted, free of charge, to any person obtaining | 4 # Permission is hereby granted, free of charge, to any person obtaining |
5 # a copy of this software and associated documentation files (the | 5 # a copy of this software and associated documentation files (the |
6 # "Software"), to deal in the Software without restriction, including | 6 # "Software"), to deal in the Software without restriction, including |
7 # without limitation the rights to use, copy, modify, merge, publish, | 7 # without limitation the rights to use, copy, modify, merge, publish, |
8 # distribute, sublicense, and/or sell copies of the Software, and to | 8 # distribute, sublicense, and/or sell copies of the Software, and to |
9 # permit persons to whom the Software is furnished to do so, subject to | 9 # permit persons to whom the Software is furnished to do so, subject to |
10 # the following conditions: | 10 # the following conditions: |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 with adding functionality that we actually use in SCons, so be wary | 48 with adding functionality that we actually use in SCons, so be wary |
49 if you lift this code for other uses. (That said, making these more | 49 if you lift this code for other uses. (That said, making these more |
50 nearly the same as later, official versions is still a desirable goal, | 50 nearly the same as later, official versions is still a desirable goal, |
51 we just don't need to be obsessive about it.) | 51 we just don't need to be obsessive about it.) |
52 | 52 |
53 If you're looking at this with pydoc and various names don't show up in | 53 If you're looking at this with pydoc and various names don't show up in |
54 the FUNCTIONS or DATA output, that means those names are already built in | 54 the FUNCTIONS or DATA output, that means those names are already built in |
55 to this version of Python and we don't need to add them from this module. | 55 to this version of Python and we don't need to add them from this module. |
56 """ | 56 """ |
57 | 57 |
58 __revision__ = "src/engine/SCons/compat/builtins.py 3603 2008/10/10 05:46:45 sco
ns" | 58 __revision__ = "src/engine/SCons/compat/builtins.py 3842 2008/12/20 22:59:52 sco
ns" |
59 | 59 |
60 import __builtin__ | 60 import __builtin__ |
61 | 61 |
62 try: | 62 try: |
63 all | 63 all |
64 except NameError: | 64 except NameError: |
65 # Pre-2.5 Python has no all() function. | 65 # Pre-2.5 Python has no all() function. |
66 def all(iterable): | 66 def all(iterable): |
67 """ | 67 """ |
68 Returns True if all elements of the iterable are true. | 68 Returns True if all elements of the iterable are true. |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 # def rstrip(s, c=string.whitespace): | 172 # def rstrip(s, c=string.whitespace): |
173 # while s and s[-1] in c: | 173 # while s and s[-1] in c: |
174 # s = s[:-1] | 174 # s = s[:-1] |
175 # return s | 175 # return s |
176 # def strip(s, c=string.whitespace, l=lstrip, r=rstrip): | 176 # def strip(s, c=string.whitespace, l=lstrip, r=rstrip): |
177 # return l(r(s, c), c) | 177 # return l(r(s, c), c) |
178 # | 178 # |
179 # object.__setattr__(str, 'lstrip', lstrip) | 179 # object.__setattr__(str, 'lstrip', lstrip) |
180 # object.__setattr__(str, 'rstrip', rstrip) | 180 # object.__setattr__(str, 'rstrip', rstrip) |
181 # object.__setattr__(str, 'strip', strip) | 181 # object.__setattr__(str, 'strip', strip) |
OLD | NEW |