source: sasview/sansmodels/src/python_wrapper/wrapping.py @ ccb7363

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 ccb7363 was 101065a, checked in by Mathieu Doucet <doucetm@…>, 13 years ago

keep only header files in c_extensions and rename it 'include'

  • Property mode set to 100644
File size: 909 bytes
Line 
1import sys
2import os
3import os.path
4from WrapperGenerator import WrapperGenerator
5
6def generate_wrappers(header_dir, output_dir='.', c_wrapper_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"), 
14                                   output_dir=output_dir,
15                                   c_wrapper_dir=c_wrapper_dir)
16            app.read()
17            app.write_c_wrapper()
18            app.write_python_wrapper()
19            #print app
20    print "Total number of model  wrappers created is %s" % nModels
21
22if __name__ == '__main__':
23    header_dir = os.path.join('..', 'include')
24    generate_wrappers(header_dir, output_dir="../sans/models/", c_wrapper_dir='.')
25
26
Note: See TracBrowser for help on using the repository browser.