def _hardcode_setup():
# A user may want to hardcode in and out paths for their analysis files. If no config file exists, it will ask if you want to store your in/out options in one and use them from then on out.
sane = 0
home_dir = str(os.path.expanduser('~'))
input_conf = raw_input('-- : -- Please enter full path to input sample directory: ')
output_conf = raw_input('-- : -- Please enter full path to sample/analysis output directory: ')
if not os.path.exists(input_conf) or not os.path.exists(output_conf):
sys.exit("-- : -- Invalid paths detected. Please check input. Run again to re-enter paths.")
print '-- : -- Is this input directory correct "'+str(input_conf)+'"?'
print '-- : -- Is this output directory correct "'+str(output_conf)+'"?'
while sane == 0:
dir_choice = raw_input('-- : -- Yes or No: ')
if dir_choice == 'Yes':
conf_file = open(home_dir+'/automal_conf.conf', 'w')
conf_file.write('ipath='+str(input_conf)+'\n')
conf_file.write('opath='+str(output_conf)+'\n')
conf_file.close()
sane = 1
if dir_choice == 'No':
sys.exit('-- : -- Exited on incorrect paths. Run again to re-enter.')
if dir_choice != 'No' and dir_choice != 'Yes':
print '-- : -- Invalid choice, try again. Yes or No.'
评论列表
文章目录