summaryrefslogtreecommitdiff
path: root/engine/SCons/Script/Interactive.py
diff options
context:
space:
mode:
Diffstat (limited to 'engine/SCons/Script/Interactive.py')
-rw-r--r--engine/SCons/Script/Interactive.py22
1 files changed, 10 insertions, 12 deletions
diff --git a/engine/SCons/Script/Interactive.py b/engine/SCons/Script/Interactive.py
index 6218021..52fc753 100644
--- a/engine/SCons/Script/Interactive.py
+++ b/engine/SCons/Script/Interactive.py
@@ -19,9 +19,8 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# 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/Script/Interactive.py 4720 2010/03/24 03:14:11 jars"
+__revision__ = "src/engine/SCons/Script/Interactive.py 5023 2010/06/14 22:05:46 scons"
__doc__ = """
SCons interactive mode
@@ -90,7 +89,6 @@ import copy
import os
import re
import shlex
-import string
import sys
try:
@@ -134,7 +132,7 @@ class SConsInteractiveCmd(cmd.Cmd):
print "*** Unknown command: %s" % argv[0]
def onecmd(self, line):
- line = string.strip(line)
+ line = line.strip()
if not line:
print self.lastcmd
return self.emptyline()
@@ -144,7 +142,7 @@ class SConsInteractiveCmd(cmd.Cmd):
elif line[0] == '?':
line = 'help ' + line[1:]
if os.sep == '\\':
- line = string.replace(line, '\\', '\\\\')
+ line = line.replace('\\', '\\\\')
argv = shlex.split(line)
argv[0] = self.synonyms.get(argv[0], argv[0])
if not argv[0]:
@@ -222,8 +220,8 @@ class SConsInteractiveCmd(cmd.Cmd):
def get_unseen_children(node, parent, seen_nodes=seen_nodes):
def is_unseen(node, seen_nodes=seen_nodes):
- return not seen_nodes.has_key(node)
- return filter(is_unseen, node.children(scan=1))
+ return node not in seen_nodes
+ return list(filter(is_unseen, node.children(scan=1)))
def add_to_seen_nodes(node, parent, seen_nodes=seen_nodes):
seen_nodes[node] = 1
@@ -247,9 +245,9 @@ class SConsInteractiveCmd(cmd.Cmd):
walker = SCons.Node.Walker(node,
kids_func=get_unseen_children,
eval_func=add_to_seen_nodes)
- n = walker.next()
+ n = walker.get_next()
while n:
- n = walker.next()
+ n = walker.get_next()
for node in seen_nodes.keys():
# Call node.clear() to clear most of the state
@@ -307,7 +305,7 @@ class SConsInteractiveCmd(cmd.Cmd):
def _strip_initial_spaces(self, s):
#lines = s.split('\n')
- lines = string.split(s, '\n')
+ lines = s.split('\n')
spaces = re.match(' *', lines[0]).group(0)
#def strip_spaces(l):
# if l.startswith(spaces):
@@ -318,8 +316,8 @@ class SConsInteractiveCmd(cmd.Cmd):
if l[:len(spaces)] == spaces:
l = l[len(spaces):]
return l
- lines = map(strip_spaces, lines)
- return string.join(lines, '\n')
+ lines = list(map(strip_spaces, lines))
+ return '\n'.join(lines)
def do_exit(self, argv):
"""\