diff options
Diffstat (limited to 'doc/user')
-rw-r--r-- | doc/user/environments.in | 10 | ||||
-rw-r--r-- | doc/user/environments.xml | 10 | ||||
-rw-r--r-- | doc/user/parseflags.in | 16 | ||||
-rw-r--r-- | doc/user/parseflags.xml | 14 |
4 files changed, 13 insertions, 37 deletions
diff --git a/doc/user/environments.in b/doc/user/environments.in index 0c04382..afd1463 100644 --- a/doc/user/environments.in +++ b/doc/user/environments.in @@ -672,11 +672,8 @@ environment, of directory names, suffixes, etc. <sconstruct> env = Environment() - dict = env.Dictionary() - keys = dict.keys() - keys.sort() - for key in keys: - print "construction variable = '%s', value = '%s'" % (key, dict[key]) + for item in sorted(env.Dictionary().items()): + print "construction variable = '%s', value = '%s'" % item </sconstruct> </section> @@ -1559,8 +1556,7 @@ environment, of directory names, suffixes, etc. if len(sys.argv) > 1: keys = sys.argv[1:] else: - keys = os.environ.keys() - keys.sort() + keys = sorted(os.environ.keys()) for key in keys: print " " + key + "=" + os.environ[key] </file> diff --git a/doc/user/environments.xml b/doc/user/environments.xml index 0746793..563d635 100644 --- a/doc/user/environments.xml +++ b/doc/user/environments.xml @@ -672,11 +672,8 @@ environment, of directory names, suffixes, etc. <programlisting> env = Environment() - dict = env.Dictionary() - keys = dict.keys() - keys.sort() - for key in keys: - print "construction variable = '%s', value = '%s'" % (key, dict[key]) + for item in sorted(env.Dictionary().items()): + print "construction variable = '%s', value = '%s'" % item </programlisting> </section> @@ -1546,8 +1543,7 @@ environment, of directory names, suffixes, etc. if len(sys.argv) > 1: keys = sys.argv[1:] else: - keys = os.environ.keys() - keys.sort() + keys = sorted(os.environ.keys()) for key in keys: print " " + key + "=" + os.environ[key] </file> diff --git a/doc/user/parseflags.in b/doc/user/parseflags.in index 733ee1d..a0ea290 100644 --- a/doc/user/parseflags.in +++ b/doc/user/parseflags.in @@ -61,9 +61,7 @@ <file name="SConstruct" printme="1"> env = Environment() d = env.ParseFlags("-I/opt/include -L/opt/lib -lfoo") - l = d.items() - l.sort() - for k,v in l: + for k,v in sorted(d.items()): if v: print k, v env.MergeFlags(d) @@ -102,9 +100,7 @@ <file name="SConstruct" printme="1"> env = Environment() d = env.ParseFlags("-whatever") - l = d.items() - l.sort() - for k,v in l: + for k,v in sorted(d.items()): if v: print k, v env.MergeFlags(d) @@ -130,9 +126,7 @@ <file name="SConstruct" printme="1"> env = Environment() d = env.ParseFlags(["-I/opt/include", ["-L/opt/lib", "-lfoo"]]) - l = d.items() - l.sort() - for k,v in l: + for k,v in sorted(d.items()): if v: print k, v env.MergeFlags(d) @@ -159,9 +153,7 @@ <file name="SConstruct" printme="1"> env = Environment() d = env.ParseFlags(["!echo -I/opt/include", "!echo -L/opt/lib", "-lfoo"]) - l = d.items() - l.sort() - for k,v in l: + for k,v in sorted(d.items()): if v: print k, v env.MergeFlags(d) diff --git a/doc/user/parseflags.xml b/doc/user/parseflags.xml index 632077e..09533d2 100644 --- a/doc/user/parseflags.xml +++ b/doc/user/parseflags.xml @@ -60,9 +60,7 @@ <programlisting> env = Environment() d = env.ParseFlags("-I/opt/include -L/opt/lib -lfoo") - l = d.items() - l.sort() - for k,v in l: + for k,v in sorted(d.items()): if v: print k, v env.MergeFlags(d) @@ -106,9 +104,7 @@ <programlisting> env = Environment() d = env.ParseFlags("-whatever") - l = d.items() - l.sort() - for k,v in l: + for k,v in sorted(d.items()): if v: print k, v env.MergeFlags(d) @@ -132,9 +128,7 @@ <programlisting> env = Environment() d = env.ParseFlags(["-I/opt/include", ["-L/opt/lib", "-lfoo"]]) - l = d.items() - l.sort() - for k,v in l: + for k,v in sorted(d.items()): if v: print k, v env.MergeFlags(d) @@ -161,8 +155,6 @@ <programlisting> env = Environment() d = env.ParseFlags(["!echo -I/opt/include", "!echo -L/opt/lib", "-lfoo"]) - l = d.items() - l.sort() for k,v in l: if v: print k, v |