From fb920d7f782fd57a40cdaf51d9b629a569c3bfd5 Mon Sep 17 00:00:00 2001 From: Nathanael Jourdane Date: Fri, 13 May 2016 19:45:59 +0200 Subject: [PATCH] Modify the python script to add comments in Granule initializations. --- src/main/resources/scripts/get_epncore_parameters.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/resources/scripts/get_epncore_parameters.py b/src/main/resources/scripts/get_epncore_parameters.py index ce5a5da..75565b1 100755 --- a/src/main/resources/scripts/get_epncore_parameters.py +++ b/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 example: `INCIDENCE_MIN("incidence_min", class.Double, false, false, "deg", "pos.posAng;stat.min", "Min incidence angle (solar zenithal angle)"),` """ -EXPORT_TYPE = 'enum' # 'CSV', or 'init', or 'enum'. +EXPORT_TYPE = 'init' # 'CSV', or 'init', or 'enum'. URL = 'https://voparis-confluence.obspm.fr/display/VES/EPN-TAP+V2.0+parameters' tmp_file, headers = urllib.request.urlretrieve(URL) @@ -41,9 +41,10 @@ for tr in table: if EXPORT_TYPE == 'CSV': print('"' + '";"'.join(row) + '"') elif EXPORT_TYPE == 'init': + comment = row[5] var_type = row[3].replace('Text', 'String').replace('Double', 'double').replace('Integer', 'int') var_name = row[0][0].lower() + row[0].replace('_', ' ').title().replace(' ', '')[1:] # camelCase - print('public %s %s;' % (var_type, var_name)) + print('/** %s */\npublic %s %s;\n' % (comment, var_type, var_name)) elif EXPORT_TYPE == 'enum': var_type = row[3].replace('Text', 'String') print('%s("%s", %s.class, %s, %s, "%s", "%s", "%s"),' -- libgit2 0.21.2