From e99c4150fa6f5e3492a28d0fa467e1c3f2699f15 Mon Sep 17 00:00:00 2001 From: zinph Date: Sun, 26 Jan 2020 19:09:52 -0500 Subject: [PATCH] added button to go back to main page. default files work. --- SIME.py | 1 - main.py | 9 +++++---- templates/success.html | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 templates/success.html diff --git a/SIME.py b/SIME.py index ed6c485..831b06e 100644 --- a/SIME.py +++ b/SIME.py @@ -214,7 +214,6 @@ class SIME: When total compound is 1000000 or library size, this function will be called to write compounds to file. ''' - print(compound_list) file_temp = self.smile_file_name + '_'+str(file_counter)+'.smiles' # attempts to split files because they get too large. Name of the first file will be "file_" + this variable with open(file_temp,'a+') as file_handler: file_handler.write('\n'.join(compound_list)) diff --git a/main.py b/main.py index 39f89e9..1143006 100644 --- a/main.py +++ b/main.py @@ -23,6 +23,10 @@ app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER def main_page(): return render_template('index.html') +@app.route('/success') +def success_page(duration): + return render_template('success.html', duration=duration) + @app.route('/collect_data',methods=['POST']) def collect_data(): form_data = request.form @@ -73,11 +77,8 @@ def collect_data(): start_time = time.time() sample.generate_templates_withExtendersNSugars(smile) duration = convert_time(time.time()-start_time) - f'Time Elapsed for Enumeration: {duration}' - return f'''Time Elapsed for Enumeration: {duration}. - Your chemical libraries have been generated. - Please check in LIBRARIES folder. The resulting files for info and smiles should be there.''' + return success_page(duration) #return form_data, form_files def convert_time(second): diff --git a/templates/success.html b/templates/success.html new file mode 100644 index 0000000..80f2b1d --- /dev/null +++ b/templates/success.html @@ -0,0 +1,19 @@ + + + + + + + +

+ Time Elapsed for Enumeration: {{duration}}.
+ Your chemical libraries have been generated.
+ Please check in LIBRARIES folder. The resulting files for info and smiles should be there. +

+
+ + +
+ + +