def IMPModuleGetExampleData(env): lst=["*.pdb", "*.mrc", "*.dat", "*.xml", "*.em", "*.rmf", "*.hdf5", "*.mol2"] ret= stp.get_matching_source(env, lst + ["*/"+x for x in lst] \ + ["*/*/"+x for x in lst]) return ret
def IMPModuleGetSwigFiles(env): vars=_get_module_variables(env) prefix=vars['module_pylibname'][1:] if prefix=="IMP": prefix="IMP_kernel" files=stp.get_matching_source(env, [prefix+".*.i"]) return files
def IMPModuleExamples(env, example_files, data_files): example_files= [File(x) for x in example_files] if env["IMP_PASS"] == "BUILD": seen=[] for e in example_files: if str(e).endswith(".py"): for o in example_files: if str(o) == scons_tools.utility.get_without_extension(str(e))+".readme": seen.append(o) break scons_tools.examples.add_python_example(env, e, o.get_contents()) links=[] fexample_files=[x for x in example_files if x not in seen] split= scons_tools.utility.get_split_into_directories(fexample_files) for k in split.keys(): if len(k)>0: name =_get_module_name(env)+ " examples: "+k pre=k+'/' else: name =_get_module_name(env)+ " examples" pre="" name=scons_tools.utility.get_display_from_name(name) l= scons_tools.examples.add_page(env, name, [pre+x for x in split[k]]) links.append(l) _set_module_links(env, links) if env["IMP_PASS"]=="RUN": module= _get_module_name(env) build=scons_tools.install.install_hierarchy_in_build(env, example_files+data_files, "#/build/doc/examples/"+module) scons_tools.data.get(env).add_to_alias(_get_module_alias(env), build) test_files = stp.get_matching_source(env, ['test_examples.py']) runable=[x for x in example_files + test_files if str(x).endswith(".py") \ and str(x).find("fragment")==-1] if len(runable)>0: tests = scons_tools.test.add_tests(env, source=runable, type='example') for t in tests: env.Depends(t, build)
def IMPModuleGetDocs(env): files=stp.get_matching_source(env, ["*.dox", "*.pdf", "*.dot", "*.png"]) return files
def IMPModuleGetBenchmarks(env): return stp.get_matching_source(env, ["*.cpp", "*.py"])
def IMPModuleGetSources(env): files=stp.get_matching_source(env,["*.cpp", "internal/*.cpp"]) return files
def IMPModuleGetHeaders(env): files=stp.get_matching_source(env, ["*.h", "internal/*.h"]) return files
def IMPModuleGetExpensiveCPPTests(env): return stp.get_matching_source(env, ["expensive_test_*.cpp", "*/expensive_test_*.cpp"])
def IMPModuleGetExpensivePythonTests(env): return stp.get_matching_source(env, ["expensive_test_*.py", "*/expensive_test_*.py"])
def IMPModuleGetCPPTests(env): return stp.get_matching_source(env, ["test_*.cpp", "*/test_*.cpp"])
def IMPModuleGetPythonTests(env): return stp.get_matching_source(env, ["test_*.py", "*/test_*.py"])
def IMPModuleGetExamples(env): rms= stp.get_matching_source(env, ["*.readme", "*.py"]) # evil, this should put put somewhere in build return [x for x in rms if not x.path.endswith("test_examples.py")]