source: sasview/sansmodels/src/python_wrapper/wrapping.py @ 37805e9

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 37805e9 was 2d1b700, checked in by Mathieu Doucet <doucetm@…>, 13 years ago

refactor refl model and auto-generate c++ wrapper at compile time.

  • Property mode set to 100644
File size: 744 bytes
Line 
1import sys
2import os
3import os.path
4from WrapperGenerator import WrapperGenerator
5
6def generate_wrappers(header_dir, output_dir='.'):
7    nModels=0
8    for item in os.listdir(header_dir):
9        toks = os.path.splitext(os.path.basename(item))
10        if toks[1]=='.h':
11            nModels += 1
12            name = toks[0]
13            app = WrapperGenerator(os.path.join(header_dir, name+".h"), output_dir=output_dir)
14            app.read()
15            app.write_c_wrapper()
16            app.write_python_wrapper()
17            #print app
18    print "Total number of model  wrappers created is %s" % nModels
19
20if __name__ == '__main__':
21    header_dir = os.path.join('..', 'c_extensions')
22    generate_wrappers(header_dir)
23
24
Note: See TracBrowser for help on using the repository browser.