summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorGreg Noel <GregNoel@tigris.org>2010-03-25 04:14:28 (GMT)
committerGreg Noel <GregNoel@tigris.org>2010-03-25 04:14:28 (GMT)
commit22d352500f1cd6bd0c53d788a5dc44a1fefa676e (patch)
tree0984fd581082c27cfbfbb7f94d5751b0e6fd2741 /doc
parent75ac32ac8e32076e25b72a19eb56340cc585fa4e (diff)
downloadSCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.zip
SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.tar.gz
SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.tar.bz2
Move 2.0 changes collected in branches/pending back to trunk for further
development. Note that this set of changes is NOT backward-compatible; the trunk no longer works with Python 1.5.2, 2.0, or 2.1.
Diffstat (limited to 'doc')
-rw-r--r--doc/SConscript35
-rw-r--r--doc/man/scons.110
-rw-r--r--doc/user/less-simple.in2
-rw-r--r--doc/user/less-simple.xml2
-rw-r--r--doc/user/tasks.in5
-rw-r--r--doc/user/tasks.xml5
6 files changed, 26 insertions, 33 deletions
diff --git a/doc/SConscript b/doc/SConscript
index b8fc502..7af3d33 100644
--- a/doc/SConscript
+++ b/doc/SConscript
@@ -24,10 +24,10 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
+from __future__ import generators ### KEEP FOR COMPATIBILITY FIXERS
import os.path
import re
-import string
Import('build_dir', 'env', 'whereis')
@@ -93,7 +93,7 @@ def scanxml(node, env, target):
if tail == 'doc':
break
a = [tail] + a
- file = apply(os.path.join, a, {})
+ file = os.path.join(*a)
includes.append(file)
return includes
@@ -119,8 +119,8 @@ def chop(s): return s[:-1]
#manifest_in = File('#src/engine/MANIFEST.in').rstr()
manifest_xml_in = File('#src/engine/MANIFEST-xml.in').rstr()
-scons_doc_files = map(chop, open(manifest_xml_in).readlines())
-scons_doc_files = map(lambda x: File('#src/engine/'+x).rstr(), scons_doc_files)
+scons_doc_files = list(map(chop, open(manifest_xml_in).readlines()))
+scons_doc_files = [File('#src/engine/'+x).rstr() for x in scons_doc_files]
if not jw:
print "jw not found, skipping building User Guide."
@@ -240,7 +240,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
# get included by the document XML files in the subdirectories.
#
manifest = File('MANIFEST').rstr()
- src_files = map(lambda x: x[:-1], open(manifest).readlines())
+ src_files = [x[:-1] for x in open(manifest).readlines()]
for s in src_files:
base, ext = os.path.splitext(s)
if ext in ['.fig', '.jpg']:
@@ -255,8 +255,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
#
for doc in docs.keys():
manifest = File(os.path.join(doc, 'MANIFEST')).rstr()
- src_files = map(lambda x: x[:-1],
- open(manifest).readlines())
+ src_files = [x[:-1] for x in open(manifest).readlines()]
build_doc = docs[doc].get('scons-doc') and int(ARGUMENTS.get('BUILDDOC', 0))
for s in src_files:
doc_s = os.path.join(doc, s)
@@ -408,8 +407,7 @@ for m in man_page_list:
man_i_files = ['builders.man', 'tools.man', 'variables.man']
-man_intermediate_files = map(lambda x: os.path.join(build, 'man', x),
- man_i_files)
+man_intermediate_files = [os.path.join(build, 'man', x) for x in man_i_files]
cmd = "$PYTHON $SCONS_PROC_PY --man -b ${TARGETS[0]} -t ${TARGETS[1]} -v ${TARGETS[2]} $( $SOURCES $)"
man_intermediate_files = env.Command(man_intermediate_files,
@@ -444,12 +442,12 @@ for man_1 in man_page_list:
def strip_to_first_html_tag(target, source, env):
t = str(target[0])
contents = open(t).read()
- contents = contents[string.find(contents, '<HTML>'):]
+ contents = contents[contents.find('<HTML>'):]
open(t, 'w').write(contents)
return 0
cmds = [
- "( cd %s/man && cp %s .. )" % (build, string.join(man_i_files)),
+ "( cd %s/man && cp %s .. )" % (build, ' '.join(man_i_files)),
"( cd ${SOURCE.dir} && man2html ${SOURCE.file} ) > $TARGET",
Action(strip_to_first_html_tag),
]
@@ -469,15 +467,15 @@ else:
# the SConstruct file.
e = os.path.join('#src', 'engine')
manifest_in = File(os.path.join(e, 'MANIFEST.in')).rstr()
- sources = map(lambda x: x[:-1], open(manifest_in).readlines())
- sources = filter(lambda x: string.find(x, 'Optik') == -1, sources)
- sources = filter(lambda x: string.find(x, 'Platform') == -1, sources)
- sources = filter(lambda x: string.find(x, 'Tool') == -1, sources)
+ sources = [x[:-1] for x in open(manifest_in).readlines()]
+ sources = [x for x in sources if x.find('Optik') == -1]
+ sources = [x for x in sources if x.find('Platform') == -1]
+ sources = [x for x in sources if x.find('Tool') == -1]
# XXX
- sources = filter(lambda x: string.find(x, 'Options') == -1, sources)
+ sources = [x for x in sources if x.find('Options') == -1]
e = os.path.join(build, '..', 'scons', 'engine')
- sources = map(lambda x, e=e: os.path.join(e, x), sources)
+ sources = [os.path.join(e, x) for x in sources]
epydoc_commands = [
Delete('$OUTDIR'),
@@ -519,8 +517,7 @@ else:
# for easy distribution to the web site.
#
if tar_deps:
- tar_list = string.join(map(lambda x, b=build+'/': string.replace(x, b, ''),
- tar_list))
+ tar_list = ' '.join([x.replace(build+'/', '') for x in tar_list])
t = env.Command(dist_doc_tar_gz, tar_deps,
"tar cf${TAR_HFLAG} - -C %s %s | gzip > $TARGET" % (build, tar_list))
AddPostAction(dist_doc_tar_gz, Chmod(dist_doc_tar_gz, 0644))
diff --git a/doc/man/scons.1 b/doc/man/scons.1
index fa9b16c..c8017c4 100644
--- a/doc/man/scons.1
+++ b/doc/man/scons.1
@@ -1841,9 +1841,7 @@ and a same-named environment method
that split a single string
into a list, separated on
strings of white-space characters.
-(These are similar to the
-string.split() method
-from the standard Python library,
+(These are similar to the split() member function of Python strings
but work even if the input isn't a string.)
Like all Python arguments,
@@ -1862,7 +1860,7 @@ env.Program('bar', env.Split('bar.c foo.c'))
env.Program(source = ['bar.c', 'foo.c'], target = 'bar')
env.Program(target = 'bar', Split('bar.c foo.c'))
env.Program(target = 'bar', env.Split('bar.c foo.c'))
-env.Program('bar', source = string.split('bar.c foo.c'))
+env.Program('bar', source = 'bar.c foo.c'.split())
.EE
Target and source file names
@@ -5534,7 +5532,7 @@ The following statements are equivalent:
.ES
env.SetDefault(FOO = 'foo')
-if not env.has_key('FOO'): env['FOO'] = 'foo'
+if 'FOO' not in env: env['FOO'] = 'foo'
.EE
'\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -9901,7 +9899,7 @@ as follows:
def pf(env, dir, target, source, arg):
top_dir = Dir('#').abspath
results = []
- if env.has_key('MYPATH'):
+ if 'MYPATH' in env:
for p in env['MYPATH']:
results.append(top_dir + os.sep + p)
return results
diff --git a/doc/user/less-simple.in b/doc/user/less-simple.in
index f7bd7d5..fcffa5e 100644
--- a/doc/user/less-simple.in
+++ b/doc/user/less-simple.in
@@ -371,7 +371,7 @@
you'll have realized that this is similar to the
<function>split()</function> method
in the Python standard <function>string</function> module.
- Unlike the <function>string.split()</function> method,
+ Unlike the <function>split()</function> member function of strings,
however, the &Split; function
does not require a string as input
and will wrap up a single non-string object in a list,
diff --git a/doc/user/less-simple.xml b/doc/user/less-simple.xml
index 0bc382e..8b781dd 100644
--- a/doc/user/less-simple.xml
+++ b/doc/user/less-simple.xml
@@ -360,7 +360,7 @@
you'll have realized that this is similar to the
<function>split()</function> method
in the Python standard <function>string</function> module.
- Unlike the <function>string.split()</function> method,
+ Unlike the <function>split()</function> member function of strings,
however, the &Split; function
does not require a string as input
and will wrap up a single non-string object in a list,
diff --git a/doc/user/tasks.in b/doc/user/tasks.in
index c51ad36..434871f 100644
--- a/doc/user/tasks.in
+++ b/doc/user/tasks.in
@@ -74,9 +74,8 @@ if filename.find(old_prefix) == 0:
<simpara>or in Python 1.5.2:</simpara>
<programlisting>
-import string
-if string.find(filename, old_prefix) == 0:
- filename = string.replace(filename, old_prefix, new_prefix)
+if filename.find(old_prefix) == 0:
+ filename = filename.replace(old_prefix, new_prefix)
</programlisting>
</example>
diff --git a/doc/user/tasks.xml b/doc/user/tasks.xml
index c51ad36..434871f 100644
--- a/doc/user/tasks.xml
+++ b/doc/user/tasks.xml
@@ -74,9 +74,8 @@ if filename.find(old_prefix) == 0:
<simpara>or in Python 1.5.2:</simpara>
<programlisting>
-import string
-if string.find(filename, old_prefix) == 0:
- filename = string.replace(filename, old_prefix, new_prefix)
+if filename.find(old_prefix) == 0:
+ filename = filename.replace(old_prefix, new_prefix)
</programlisting>
</example>