Last change
on this file since 23677 was 23677, checked in by bdef, 6 years ago |
CHG: adding missing directories and cleaning code
|
File size:
621 bytes
|
Rev | Line | |
---|
[23677] | 1 | #move this later:
|
---|
| 2 | from helpers import *
|
---|
| 3 |
|
---|
| 4 | def param_write(fidi,sbeg,pname,smid,s,params):
|
---|
| 5 | '''
|
---|
| 6 | function to write a parameter
|
---|
| 7 | '''
|
---|
| 8 | if not isfield(params,pname):
|
---|
| 9 | print('WARNING: param_write:param_not_found: Parameter '+str(pname)+' not found in structure.')
|
---|
| 10 | return
|
---|
| 11 |
|
---|
| 12 | params_pname = vars(params)[pname]
|
---|
| 13 |
|
---|
| 14 | if type(params_pname) == bool and (not params_pname):
|
---|
| 15 | return
|
---|
| 16 |
|
---|
| 17 | if type(params_pname) == bool:
|
---|
| 18 | fidi.write(sbeg+str(pname)+s)
|
---|
| 19 |
|
---|
| 20 | elif type(params_pname) in [str]:
|
---|
| 21 | fidi.write(sbeg+str(pname)+smid+params_pname+s)
|
---|
| 22 |
|
---|
| 23 | elif type(params_pname) in [int, float]:
|
---|
| 24 | fidi.write(sbeg+str(pname)+smid+str(params_pname)+s)
|
---|
| 25 |
|
---|
| 26 |
|
---|
| 27 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.