通过绝对路径加载SCons工具

时间:2013-05-19 18:09:44

标签: scons

我有一个SCons工具,当我将mytool.py__init__.py放在site_scons/site_tools/mytool下时,它可以正常工作。

现在我想把它更改为通过来自其他地方的绝对路径引用。

所以我通过以下方式打电话:

mytoolpath = '/tools/mytool'
env = Environment(tools=['mytool'], toolpath=mytoolpath)

并且除了EnvironmentError: No tool named 'mytool': not a Zip file:

mytool.py位于/tools/mytool,所以我真的不明白问题出在哪里。有人可以解释一下。

1 个答案:

答案 0 :(得分:2)

事实证明,这是为数不多的几个地方之一,其中字符串不会被转换为列表。 所以你必须通过以下方式调用它:

env = Environment(tools=['mytool'], toolpath=[mytoolpath])
相关问题