summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Tool
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2008-12-12 06:16:31 (GMT)
committerSteven Knight <knight@baldmt.com>2008-12-12 06:16:31 (GMT)
commit6554d8631debd788d6bad226d098daee080ca20e (patch)
treef468f63915d4ba1b0ea3cc2d064d5ce922cfe6e4 /src/engine/SCons/Tool
parent8e1e691178fb24207d0e073a8c67bd8810211396 (diff)
downloadSCons-6554d8631debd788d6bad226d098daee080ca20e.zip
SCons-6554d8631debd788d6bad226d098daee080ca20e.tar.gz
SCons-6554d8631debd788d6bad226d098daee080ca20e.tar.bz2
Issue 2255: Handle scanning of UTF-8 and UTF-16 files. (Greg Spencer)
Diffstat (limited to 'src/engine/SCons/Tool')
-rw-r--r--src/engine/SCons/Tool/FortranCommon.py2
-rw-r--r--src/engine/SCons/Tool/jar.py6
-rw-r--r--src/engine/SCons/Tool/qt.py10
-rw-r--r--src/engine/SCons/Tool/tex.py8
4 files changed, 13 insertions, 13 deletions
diff --git a/src/engine/SCons/Tool/FortranCommon.py b/src/engine/SCons/Tool/FortranCommon.py
index 825cbe5..bf32ffa 100644
--- a/src/engine/SCons/Tool/FortranCommon.py
+++ b/src/engine/SCons/Tool/FortranCommon.py
@@ -67,7 +67,7 @@ def _fortranEmitter(target, source, env):
mod_regex = """(?i)^\s*MODULE\s+(?!PROCEDURE)(\w+)"""
cre = re.compile(mod_regex,re.M)
# Retrieve all USE'd module names
- modules = cre.findall(node.get_contents())
+ modules = cre.findall(node.get_text_contents())
# Remove unique items from the list
modules = SCons.Util.unique(modules)
# Convert module name to a .mod filename
diff --git a/src/engine/SCons/Tool/jar.py b/src/engine/SCons/Tool/jar.py
index 6594ecc..7018c37 100644
--- a/src/engine/SCons/Tool/jar.py
+++ b/src/engine/SCons/Tool/jar.py
@@ -49,7 +49,7 @@ def jarSources(target, source, env, for_signature):
jarchdir = env.fs.Dir(jarchdir)
result = []
for src in source:
- contents = src.get_contents()
+ contents = src.get_text_contents()
if contents[:16] != "Manifest-Version":
if jarchdir_set:
_chdir = jarchdir
@@ -70,7 +70,7 @@ def jarSources(target, source, env, for_signature):
def jarManifest(target, source, env, for_signature):
"""Look in sources for a manifest file, if any."""
for src in source:
- contents = src.get_contents()
+ contents = src.get_text_contents()
if contents[:16] == "Manifest-Version":
return src
return ''
@@ -80,7 +80,7 @@ def jarFlags(target, source, env, for_signature):
flag is specified."""
jarflags = env.subst('$JARFLAGS', target=target, source=source)
for src in source:
- contents = src.get_contents()
+ contents = src.get_text_contents()
if contents[:16] == "Manifest-Version":
if not 'm' in jarflags:
return jarflags + 'm'
diff --git a/src/engine/SCons/Tool/qt.py b/src/engine/SCons/Tool/qt.py
index d67cddb..e2aa441 100644
--- a/src/engine/SCons/Tool/qt.py
+++ b/src/engine/SCons/Tool/qt.py
@@ -138,8 +138,8 @@ class _Automoc:
print "scons: qt: '%s' is no cxx file. Discarded." % str(cpp)
# c or fortran source
continue
- #cpp_contents = comment.sub('', cpp.get_contents())
- cpp_contents = cpp.get_contents()
+ #cpp_contents = comment.sub('', cpp.get_text_contents())
+ cpp_contents = cpp.get_text_contents()
h=None
for h_ext in header_extensions:
# try to find the header file in the corresponding source
@@ -149,8 +149,8 @@ class _Automoc:
if h:
if debug:
print "scons: qt: Scanning '%s' (header of '%s')" % (str(h), str(cpp))
- #h_contents = comment.sub('', h.get_contents())
- h_contents = h.get_contents()
+ #h_contents = comment.sub('', h.get_text_contents())
+ h_contents = h.get_text_contents()
break
if not h and debug:
print "scons: qt: no header for '%s'." % (str(cpp))
@@ -221,7 +221,7 @@ def uicScannerFunc(node, env, path):
lookout = []
lookout.extend(env['CPPPATH'])
lookout.append(str(node.rfile().dir))
- includes = re.findall("<include.*?>(.*?)</include>", node.get_contents())
+ includes = re.findall("<include.*?>(.*?)</include>", node.get_text_contents())
result = []
for incFile in includes:
dep = env.FindFile(incFile,lookout)
diff --git a/src/engine/SCons/Tool/tex.py b/src/engine/SCons/Tool/tex.py
index 49da3d0..15e2d3e 100644
--- a/src/engine/SCons/Tool/tex.py
+++ b/src/engine/SCons/Tool/tex.py
@@ -198,7 +198,7 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
# we have to run makeindex at least once to keep the build
# happy even if there is no index.
# Same for glossaries and nomenclature
- src_content = source[0].get_contents()
+ src_content = source[0].get_text_contents()
run_makeindex = makeindex_re.search(src_content) and not os.path.exists(targetbase + '.idx')
run_nomenclature = makenomenclature_re.search(src_content) and not os.path.exists(targetbase + '.nlo')
run_glossary = makeglossary_re.search(src_content) and not os.path.exists(targetbase + '.glo')
@@ -373,7 +373,7 @@ LaTeX_re = re.compile("\\\\document(style|class)")
def is_LaTeX(flist):
# Scan a file list to decide if it's TeX- or LaTeX-flavored.
for f in flist:
- content = f.get_contents()
+ content = f.get_text_contents()
if LaTeX_re.search(content):
return 1
return 0
@@ -422,7 +422,7 @@ def tex_pdf_emitter(target, source, env):
def ScanFiles(theFile, target, paths, file_tests, file_tests_search, env, graphics_extensions, targetdir):
# for theFile (a Node) update any file_tests and search for graphics files
# then find all included files and call ScanFiles for each of them
- content = theFile.get_contents()
+ content = theFile.get_text_contents()
if Verbose:
print " scanning ",str(theFile)
@@ -498,7 +498,7 @@ def tex_emitter_core(target, source, env, graphics_extensions):
env.Clean(target[0],auxfilename)
env.Clean(target[0],logfilename)
- content = source[0].get_contents()
+ content = source[0].get_text_contents()
idx_exists = os.path.exists(targetbase + '.idx')
nlo_exists = os.path.exists(targetbase + '.nlo')