Skip to content
Snippets Groups Projects
Commit 053b6720 authored by Marko Mecina's avatar Marko Mecina
Browse files

modify header info created in TC template generator

parent b9241ca6
No related branches found
No related tags found
No related merge requests found
...@@ -9,12 +9,12 @@ import ccs_function_lib as cfl ...@@ -9,12 +9,12 @@ import ccs_function_lib as cfl
def export(outfile, sep): def export(outfile, sep):
project = cfl.project.split('_')[-1] # project = cfl.project.split('_')[-1]
mib = cfl.scoped_session_idb.get_bind().url.database mib = cfl.scoped_session_idb.get_bind().url.database
date = datetime.datetime.now().strftime('%Y-%m-%d') date = datetime.datetime.now().strftime('%Y-%m-%d')
vers = '{}.{}.{}'.format(*cfl.scoped_session_idb.execute('select * from vdf').fetchall()[0][2:]) vers = '{}.{}'.format(*cfl.scoped_session_idb.execute('select * from vdf').fetchall()[0][3:])
header = '# {} TC templates generated from schema {} (VDF:{})\n# Date: {}\n\n'.format(project, mib, vers, date) header = '# TC templates generated from schema {} (VDF:{})\n# Date: {}\n\n'.format(mib, vers, date)
temps = [] temps = []
for tc in cfl.get_tc_list(): for tc in cfl.get_tc_list():
...@@ -23,7 +23,7 @@ def export(outfile, sep): ...@@ -23,7 +23,7 @@ def export(outfile, sep):
with open(outfile, 'w') as fd: with open(outfile, 'w') as fd:
fd.write(header + sep.join(temps)) fd.write(header + sep.join(temps))
print('TC templates exported to {}.'.format(outfile)) print('TC templates exported from {} to {}.'.format(mib, outfile))
if __name__ == '__main__': if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment