summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-05-19 08:47:04 (GMT)
committerKevin Smith <kevin.smith@isode.com>2015-05-19 10:33:54 (GMT)
commited23f4578d6a5776b77e743ad54802d55f54f7e1 (patch)
tree36bd0737bf6a9890577baa796858d1ce75b62537 /BuildTools/DocBook/SCons/FO.py
parente86a46545e23ad824d7013c3c57bd83a52ade9af (diff)
downloadswift-ed23f4578d6a5776b77e743ad54802d55f54f7e1.zip
swift-ed23f4578d6a5776b77e743ad54802d55f54f7e1.tar.bz2
Consolidate Python and SCons files to tab based indentation
Test-Information: Verified that SCons still runs on OS X. Change-Id: I7e9b97f90ee5581a691a959b6f2c999d93e0be53
Diffstat (limited to 'BuildTools/DocBook/SCons/FO.py')
-rw-r--r--BuildTools/DocBook/SCons/FO.py64
1 files changed, 32 insertions, 32 deletions
diff --git a/BuildTools/DocBook/SCons/FO.py b/BuildTools/DocBook/SCons/FO.py
index c7596d6..a4079d7 100644
--- a/BuildTools/DocBook/SCons/FO.py
+++ b/BuildTools/DocBook/SCons/FO.py
@@ -6,40 +6,40 @@ import xml.dom.minidom, re
################################################################################
def generate(env) :
- def generate_actions(source, target, env, for_signature) :
- if len(env["FOCFG"]) > 0 :
- cmd = "$FO -c $FOCFG $FOFLAGS $SOURCE $TARGET"
- else :
- cmd = "$FO $FOFLAGS $SOURCE $TARGET"
- return SCons.Action.Action(cmd, cmdstr = "$FOCOMSTR")
+ def generate_actions(source, target, env, for_signature) :
+ if len(env["FOCFG"]) > 0 :
+ cmd = "$FO -c $FOCFG $FOFLAGS $SOURCE $TARGET"
+ else :
+ cmd = "$FO $FOFLAGS $SOURCE $TARGET"
+ return SCons.Action.Action(cmd, cmdstr = "$FOCOMSTR")
- def modify_sources(target, source, env) :
- if len(env["FOCFG"]) > 0 :
- source.append(env["FOCFG"])
- return target, source
+ def modify_sources(target, source, env) :
+ if len(env["FOCFG"]) > 0 :
+ source.append(env["FOCFG"])
+ return target, source
- def scan_fo(node, env, path) :
- dependencies = set()
- try :
- document = xml.dom.minidom.parseString(node.get_contents())
- except xml.parsers.expat.ExpatError:
- return []
- for include in document.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Format", "external-graphic") :
- m = re.match("url\((.*)\)", include.getAttribute("src"))
- if m :
- dependencies.add(m.group(1))
- return list(dependencies)
+ def scan_fo(node, env, path) :
+ dependencies = set()
+ try :
+ document = xml.dom.minidom.parseString(node.get_contents())
+ except xml.parsers.expat.ExpatError:
+ return []
+ for include in document.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Format", "external-graphic") :
+ m = re.match("url\((.*)\)", include.getAttribute("src"))
+ if m :
+ dependencies.add(m.group(1))
+ return list(dependencies)
- env["FO"] = "fop"
- env["FOFLAGS"] = ""
- env["FOCFG"] = ""
- env["BUILDERS"]["FO"] = SCons.Builder.Builder(
- generator = generate_actions,
- emitter = modify_sources,
- source_scanner = SCons.Scanner.Scanner(function = scan_fo, skeys = [".fo"]),
- suffix = ".pdf",
- src_suffix = ".fo"
- )
+ env["FO"] = "fop"
+ env["FOFLAGS"] = ""
+ env["FOCFG"] = ""
+ env["BUILDERS"]["FO"] = SCons.Builder.Builder(
+ generator = generate_actions,
+ emitter = modify_sources,
+ source_scanner = SCons.Scanner.Scanner(function = scan_fo, skeys = [".fo"]),
+ suffix = ".pdf",
+ src_suffix = ".fo"
+ )
def exists(env) :
- return True
+ return True