Skip to content

Commit

Permalink
Update _scons.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pfernique committed Aug 26, 2016
1 parent 0efe8ca commit fff037f
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions src/py/autowig/_scons.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ def __init__(self, out, err, lexer=BashSessionLexer()):
def __str__(self):
return self.out + self.err

def _repr_html_(self):
return highlight(str(self), self.lexer, HtmlFormatter(full = True))

def scons(directory, *args, **kwargs):
if not isinstance(directory, path):
directory = path(directory)
Expand All @@ -34,40 +31,3 @@ def scons(directory, *args, **kwargs):
s = subprocess.Popen(['scons']+[arg for arg in args] , cwd=directory, **kwargs)
out, err = s.communicate()
return ShellSession(out, err, lexer=lexer)

def boost_python_action(target, source, env, **kwargs):

from autowig import AbstractSemanticGraph, parser, controller, generator

asg = AbstractSemanticGraph()

if 'autowig_parser' in env:
parser.plugin = env['autowig_parser']
parser(asg, [str(src) for src in source],
flags=env.subst('$CPPFLAGS $CFLAGS $CCFLAGS $CXXFLAGS').split() + ['-I' + cpppath.strip() for cpppath in env.subst('$CPPPATH').split()],
env=env)

if 'autowig_controller' in env:
controller.plugin = env['autowig_controller']
controller(asg,
env=env)

if 'autowig_generator' in env:
generator.plugin = env['autowig_generator']
else:
generator.plugin = 'boost_python_internal'
wrapper = generator(asg, module=target[1], decorator=target[0], env=env)

wrapper.write()

print 'autowig: Done generating Boost.Python wrappers'
return 0

def boost_python_string(target, source, env):
return "autowig: Generating Boost.Python wrappers"""

def boost_python_builder(env):
"""
"""
boost_python_builder = env.Builder(action=env.Action(boost_python_action, boost_python_string))
env.Append(BUILDERS = {'BoostPython' : boost_python_builder})

0 comments on commit fff037f

Please sign in to comment.