cross sections xml file now updated if binary conversion occurs

This commit is contained in:
Bryan Herman 2014-04-10 16:48:59 -04:00
parent c4272de131
commit 5b5e67701a

View file

@ -138,3 +138,15 @@ if not response or response.lower().startswith('y'):
for f in ace_files:
print(' Coverting {0}...'.format(os.path.split(f)[1]))
ascii_to_binary(f, f)
# Change cross_sections.xml file
xs_file = os.path.join('nndc', 'cross_sections.xml')
asc_str = "<filetype>ascii</filetype>"
bin_str = "<filetype> binary </filetype>\n "
bin_str += "<record_length> 4096 </record_length>\n "
bin_str += "<entries> 512 </entries>"
with open(xs_file) as fh:
text = fh.read()
text = text.replace(asc_str, bin_str)
with open(xs_file, 'w') as fh:
fh.write(text)