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 a6d1676 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
|
Rev | Line | |
---|
[9ce41c6] | 1 | import sys |
---|
| 2 | import os |
---|
| 3 | import os.path |
---|
| 4 | from WrapperGenerator import WrapperGenerator |
---|
| 5 | |
---|
[642a025] | 6 | def generate_wrappers(header_dir, output_dir='.', c_wrapper_dir='.'): |
---|
[2d1b700] | 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] |
---|
[642a025] | 13 | app = WrapperGenerator(os.path.join(header_dir, name+".h"), |
---|
| 14 | output_dir=output_dir, |
---|
| 15 | c_wrapper_dir=c_wrapper_dir) |
---|
[2d1b700] | 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 | |
---|
| 22 | if __name__ == '__main__': |
---|
[101065a] | 23 | header_dir = os.path.join('..', 'include') |
---|
[642a025] | 24 | generate_wrappers(header_dir, output_dir="../sans/models/", c_wrapper_dir='.') |
---|
[9ce41c6] | 25 | |
---|
| 26 | |
---|
Note: See
TracBrowser
for help on using the repository browser.