|
Last change
on this file since 23709 was 23709, checked in by bdef, 7 years ago |
|
CHG: pyhton 3 migration (not opperational yet)
|
|
File size:
615 bytes
|
| Line | |
|---|
| 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 {} not found in structure.'.format(pname))
|
|---|
| 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+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)
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.