Commit fb920d7f782fd57a40cdaf51d9b629a569c3bfd5
1 parent
4aa77b3e
Exists in
master
Modify the python script to add comments in Granule initializations.
Showing
1 changed file
with
3 additions
and
2 deletions
Show diff stats
src/main/resources/scripts/get_epncore_parameters.py
@@ -15,7 +15,7 @@ This script parse the Parameters table on the EpnTAPv2 VO-Paris Confluence page | @@ -15,7 +15,7 @@ This script parse the Parameters table on the EpnTAPv2 VO-Paris Confluence page | ||
15 | example: `INCIDENCE_MIN("incidence_min", class.Double, false, false, "deg", "pos.posAng;stat.min", "Min incidence angle (solar zenithal angle)"),` | 15 | example: `INCIDENCE_MIN("incidence_min", class.Double, false, false, "deg", "pos.posAng;stat.min", "Min incidence angle (solar zenithal angle)"),` |
16 | """ | 16 | """ |
17 | 17 | ||
18 | -EXPORT_TYPE = 'enum' # 'CSV', or 'init', or 'enum'. | 18 | +EXPORT_TYPE = 'init' # 'CSV', or 'init', or 'enum'. |
19 | URL = 'https://voparis-confluence.obspm.fr/display/VES/EPN-TAP+V2.0+parameters' | 19 | URL = 'https://voparis-confluence.obspm.fr/display/VES/EPN-TAP+V2.0+parameters' |
20 | 20 | ||
21 | tmp_file, headers = urllib.request.urlretrieve(URL) | 21 | tmp_file, headers = urllib.request.urlretrieve(URL) |
@@ -41,9 +41,10 @@ for tr in table: | @@ -41,9 +41,10 @@ for tr in table: | ||
41 | if EXPORT_TYPE == 'CSV': | 41 | if EXPORT_TYPE == 'CSV': |
42 | print('"' + '";"'.join(row) + '"') | 42 | print('"' + '";"'.join(row) + '"') |
43 | elif EXPORT_TYPE == 'init': | 43 | elif EXPORT_TYPE == 'init': |
44 | + comment = row[5] | ||
44 | var_type = row[3].replace('Text', 'String').replace('Double', 'double').replace('Integer', 'int') | 45 | var_type = row[3].replace('Text', 'String').replace('Double', 'double').replace('Integer', 'int') |
45 | var_name = row[0][0].lower() + row[0].replace('_', ' ').title().replace(' ', '')[1:] # camelCase | 46 | var_name = row[0][0].lower() + row[0].replace('_', ' ').title().replace(' ', '')[1:] # camelCase |
46 | - print('public %s %s;' % (var_type, var_name)) | 47 | + print('/** %s */\npublic %s %s;\n' % (comment, var_type, var_name)) |
47 | elif EXPORT_TYPE == 'enum': | 48 | elif EXPORT_TYPE == 'enum': |
48 | var_type = row[3].replace('Text', 'String') | 49 | var_type = row[3].replace('Text', 'String') |
49 | print('%s("%s", %s.class, %s, %s, "%s", "%s", "%s"),' | 50 | print('%s("%s", %s.class, %s, %s, "%s", "%s", "%s"),' |