Commit 4c1a6efe authored by Marcel Huber's avatar Marcel Huber
Browse files

using more explicit imports

parent 7854244e
......@@ -69,4 +69,4 @@ def generate(env):
def exists(env):
return 1
return True
......@@ -15,9 +15,9 @@ syntax
# -------------------------------------------------------------------------
import re
import SCons.Node
import SCons.Action
from SCons.Script import Depends, Builder
from SCons.Action import Action
from SCons.Builder import Builder
from SCons.Script import Depends
def substInFile(target, source, searchre, subfn):
......@@ -68,15 +68,16 @@ def getData(keys, env):
def substituted_filename_emitter(target, source, env):
from SCons.Node import FS, Python
newTarget = []
for (t, s) in zip(target, source):
if isinstance(t, SCons.Node.FS.Dir):
if isinstance(t, FS.Dir):
newTarget.append(t.File(s.name))
else:
newTarget.append(t)
keys = getKeysFromFile(str(s), getSearchRE(env))
data = getData(keys, env)
Depends(t, SCons.Node.Python.Value(data))
Depends(t, Python.Value(data))
env.AlwaysBuild(newTarget)
return (newTarget, source)
......@@ -124,7 +125,7 @@ def substInFiles(target, source, env):
def generate(env):
from SCons.Tool import install
substInFileAction = SCons.Action.Action(substInFiles, getLogMessage)
substInFileAction = Action(substInFiles, getLogMessage)
substInFileBuilder = Builder(
action=substInFileAction,
emitter=[substituted_filename_emitter, install.add_targets_to_INSTALLED_FILES])
......
......@@ -168,8 +168,8 @@ def generate(env):
help='Specify directory prefix for third party build output, default=["' + prefix_default +
'"]')
Callback().register('PostPackageCollection', postPackageCollection)
Callback().register('PrePackageCollection', prePackageCollection)
Callback().register('PostPackageCollection', postPackageCollection)
def exists(env):
......
......@@ -17,8 +17,8 @@ SConsider-specific stand alone script to execute programs
import os
import datetime
import tempfile
import SCons.Action
import SCons.Builder
from SCons.Action import Action
from SCons.Builder import Builder
from SConsider.SomeUtils import getPyFilename
......@@ -342,11 +342,11 @@ def generateWrapperScript(env, target):
def generate(env):
from SCons.Tool import install
GenerateScriptAction = SCons.Action.Action(generatePosixScript,
"Creating wrapper script '$TARGET' for '$SOURCE'")
GenerateScriptBuilder = SCons.Builder.Builder(
action=[GenerateScriptAction, SCons.Defaults.Chmod('$TARGET', 0755)],
emitter=[generateScriptEmitter, install.add_targets_to_INSTALLED_FILES])
from SCons.Defaults import Chmod
GenerateScriptAction = Action(generatePosixScript, "Creating wrapper script '$TARGET' for '$SOURCE'")
GenerateScriptBuilder = Builder(action=[GenerateScriptAction,
Chmod('$TARGET', 0755)],
emitter=[generateScriptEmitter, install.add_targets_to_INSTALLED_FILES])
env.Append(BUILDERS={'GenerateScriptBuilder': GenerateScriptBuilder})
env.AddMethod(generateWrapperScript, "GenerateWrapperScript")
......
......@@ -20,8 +20,8 @@ import os
import re
import platform
from logging import getLogger
import SCons.Action
import SCons.Builder
from SCons.Action import Action
from SCons.Builder import Builder
from SConsider.LibFinder import EmitLibSymlinks, versionedLibVersion
logger = getLogger(__name__)
......@@ -242,9 +242,8 @@ def generate(env):
from SCons.Tool import install
import SCons.Defaults
SymbolicLinkAction = SCons.Action.Action(createSymLink,
"Generating symbolic link for '$SOURCE' as '$TARGET'")
SymbolicLinkBuilder = SCons.Builder.Builder(
SymbolicLinkAction = Action(createSymLink, "Generating symbolic link for '$SOURCE' as '$TARGET'")
SymbolicLinkBuilder = Builder(
action=[SymbolicLinkAction],
emitter=[install.add_targets_to_INSTALLED_FILES],
)
......@@ -253,25 +252,22 @@ def generate(env):
def wrapPrecompLibAction(target, source, env):
return install.installVerLib_action(target, source, env)
PrecompLibAction = SCons.Action.Action(wrapPrecompLibAction,
"Installing precompiled library '$SOURCE' as '$TARGET'")
PrecompLibBuilder = SCons.Builder.Builder(action=[PrecompLibAction],
emitter=[
precompLibNamesEmitter, SCons.Defaults.SharedObjectEmitter,
install.add_versioned_targets_to_INSTALLED_FILES
],
multi=0,
source_factory=env.fs.Entry,
single_source=True)
PrecompLibAction = Action(wrapPrecompLibAction, "Installing precompiled library '$SOURCE' as '$TARGET'")
PrecompLibBuilder = Builder(action=[PrecompLibAction],
emitter=[
precompLibNamesEmitter, SCons.Defaults.SharedObjectEmitter,
install.add_versioned_targets_to_INSTALLED_FILES
],
multi=0,
source_factory=env.fs.Entry,
single_source=True)
env.Append(BUILDERS={'PrecompiledLibraryInstallBuilder': PrecompLibBuilder})
PrecompBinAction = SCons.Action.Action(install.installFunc,
"Installing precompiled binary '$SOURCE' as '$TARGET'")
PrecompBinBuilder = SCons.Builder.Builder(
action=[PrecompBinAction],
emitter=[precompBinNamesEmitter, install.add_targets_to_INSTALLED_FILES],
single_source=False)
PrecompBinAction = Action(install.installFunc, "Installing precompiled binary '$SOURCE' as '$TARGET'")
PrecompBinBuilder = Builder(action=[PrecompBinAction],
emitter=[precompBinNamesEmitter, install.add_targets_to_INSTALLED_FILES],
single_source=False)
env.Append(BUILDERS={'PrecompiledBinaryInstallBuilder': PrecompBinBuilder})
Callback().register('PrePackageCollection', prePackageCollection)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment