mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Ask user to delete downloaded tgz files.
This commit is contained in:
parent
1fb2bb96f6
commit
a96c6ad474
1 changed files with 17 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ from __future__ import print_function
|
|||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tarfile
|
||||
import urllib2
|
||||
|
||||
|
|
@ -70,3 +71,19 @@ for f in files:
|
|||
|
||||
print('Copying cross_sections_nndc.xml...')
|
||||
shutil.copyfile('cross_sections_nndc.xml', 'nndc/cross_sections.xml')
|
||||
|
||||
# ==============================================================================
|
||||
# PROMPT USER TO DELETE .TAR.GZ FILES
|
||||
|
||||
# Ask user to delete
|
||||
if sys.version_info[0] < 3:
|
||||
response = raw_input('Delete *.tar.gz files? ([y]/n) ')
|
||||
else:
|
||||
response = input('Delete *.tar.gz files? ([y]/n) ')
|
||||
|
||||
# Delete files if requested
|
||||
if not response or response.lower().startswith('y'):
|
||||
for f in files:
|
||||
if os.path.exists(f):
|
||||
print('Removing {0}...'.format(f))
|
||||
os.remove(f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue