summaryrefslogtreecommitdiffstats
path: root/test/Glob
diff options
context:
space:
mode:
authorGreg Noel <GregNoel@tigris.org>2010-03-27 07:39:52 (GMT)
committerGreg Noel <GregNoel@tigris.org>2010-03-27 07:39:52 (GMT)
commit59ed0a109bf5add2efcef459080837b11066c6fb (patch)
treefff879b4f9676a72e16c0f7b4dd969f050038b4f /test/Glob
parent00a3188193ba1feef927cf18e7f5fc20ad71b848 (diff)
downloadSCons-59ed0a109bf5add2efcef459080837b11066c6fb.zip
SCons-59ed0a109bf5add2efcef459080837b11066c6fb.tar.gz
SCons-59ed0a109bf5add2efcef459080837b11066c6fb.tar.bz2
http://scons.tigris.org/issues/show_bug.cgi?id=2329
Applied a number of idiomatic changes. Uses of the 'sort()' method were converted into calls of 'sorted()' when possible and the sorted() expression was inserted into a subsequent statement whenever that made sense. The statement 'while 1:' was changed to 'while True:'. Names from the 'types' module (e.g., 'types.FooType') were converted to the equivalent build-in type (e.g., 'foo'). Comparisons between types were changed to use 'isinstance()'.
Diffstat (limited to 'test/Glob')
-rw-r--r--test/Glob/Repository.py4
-rw-r--r--test/Glob/VariantDir.py4
-rw-r--r--test/Glob/basic.py4
-rw-r--r--test/Glob/source.py8
-rw-r--r--test/Glob/strings.py4
-rw-r--r--test/Glob/subdir.py4
-rw-r--r--test/Glob/subst.py4
7 files changed, 9 insertions, 23 deletions
diff --git a/test/Glob/Repository.py b/test/Glob/Repository.py
index 5783443..0a2e326 100644
--- a/test/Glob/Repository.py
+++ b/test/Glob/Repository.py
@@ -75,9 +75,7 @@ test.write(['repository', 'src', 'SConscript'], """
Import("env")
env.Build('xxx.out', Glob('x*.in'))
env.Build('yyy.out', Glob('yy?.in'))
-zzz_in = Glob('*/zzz.in')
-zzz_in.sort(lambda a,b: cmp(a.abspath, b.abspath))
-env.Build('zzz.out', zzz_in)
+env.Build('zzz.out', sorted(Glob('*/zzz.in'), key=lambda t: t.abspath))
""")
test.write(['repository', 'src', 'xxx.in'], "repository/src/xxx.in\n")
diff --git a/test/Glob/VariantDir.py b/test/Glob/VariantDir.py
index 62226ce..175e5b9 100644
--- a/test/Glob/VariantDir.py
+++ b/test/Glob/VariantDir.py
@@ -54,9 +54,7 @@ def concatenate(target, source, env):
env['BUILDERS']['Concatenate'] = Builder(action=concatenate)
-f_in = Glob('f*.in')
-f_in.sort(lambda a,b: cmp(a.name, b.name))
-env.Concatenate('f.out', f_in)
+env.Concatenate('f.out', sorted(Glob('f*.in'), key=lambda t: t.name))
""")
test.write(['src', 'f1.in'], "src/f1.in\n")
diff --git a/test/Glob/basic.py b/test/Glob/basic.py
index d985a73..9afbbc6 100644
--- a/test/Glob/basic.py
+++ b/test/Glob/basic.py
@@ -43,9 +43,7 @@ def concatenate(target, source, env):
env['BUILDERS']['Concatenate'] = Builder(action=concatenate)
-f_in = Glob('f*.in')
-f_in.sort(lambda a,b: cmp(a.name, b.name))
-env.Concatenate('f.out', f_in)
+env.Concatenate('f.out', sorted(Glob('f*.in'), key=lambda t: t.name))
""")
test.write('f1.in', "f1.in\n")
diff --git a/test/Glob/source.py b/test/Glob/source.py
index 33baf37..afa17f5 100644
--- a/test/Glob/source.py
+++ b/test/Glob/source.py
@@ -59,16 +59,14 @@ SConscript('var2/SConscript')
test.write(['var1', 'SConscript'], """\
Import("env")
-f_in = Glob('f[45].in', source=True)
-f_in.sort(lambda a,b: cmp(a.name, b.name))
-env.Concatenate('f.out', f_in)
+env.Concatenate('f.out', sorted(Glob('f[45].in', source=True),
+ key=lambda t: t.name))
""")
test.write(['var2', 'SConscript'], """\
Import("env")
-f_in = Glob('f[67].in')
-f_in.sort(lambda a,b: cmp(a.name, b.name))
+f_in = sorted(Glob('f[67].in'), cmp=lambda a,b: cmp(a.name, b.name))
env.Concatenate('f.out', f_in)
""")
diff --git a/test/Glob/strings.py b/test/Glob/strings.py
index 1ef0421..3e47d10 100644
--- a/test/Glob/strings.py
+++ b/test/Glob/strings.py
@@ -55,9 +55,7 @@ def concatenate(target, source, env):
env['BUILDERS']['Concatenate'] = Builder(action=concatenate)
-f_in = Glob('f*.in', strings=True)
-f_in.sort()
-env.Concatenate('f.out', f_in)
+env.Concatenate('f.out', sorted(Glob('f*.in', strings=True)))
""")
test.write(['src', 'f1.in'], "src/f1.in\n")
diff --git a/test/Glob/subdir.py b/test/Glob/subdir.py
index 0255ff8..6fc00f6 100644
--- a/test/Glob/subdir.py
+++ b/test/Glob/subdir.py
@@ -46,9 +46,7 @@ def concatenate(target, source, env):
env['BUILDERS']['Concatenate'] = Builder(action=concatenate)
-f_in = Glob('subdir/*.in')
-f_in.sort(lambda a,b: cmp(a.name, b.name))
-env.Concatenate('f.out', f_in)
+env.Concatenate('f.out', sorted(Glob('subdir/*.in'), key=lambda t: t.name))
""")
test.write(['subdir', 'file.in'], "subdir/file.in\n")
diff --git a/test/Glob/subst.py b/test/Glob/subst.py
index abf2bb4..e21da81 100644
--- a/test/Glob/subst.py
+++ b/test/Glob/subst.py
@@ -44,9 +44,7 @@ def copy(target, source, env):
env['BUILDERS']['Copy'] = Builder(action=copy)
-f_in = env.Glob('$PATTERN')
-f_in.sort(lambda a,b: cmp(a.name, b.name))
-env.Copy('f.out', f_in)
+env.Copy('f.out', sorted(env.Glob('$PATTERN'), key=lambda t: t.name))
""")
test.write('f1.in', "f1.in\n")