EZ4Fanta commited on
Commit
4a48c2a
·
1 Parent(s): 7df8c54
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -133,18 +133,18 @@ def handle_file_upload(file):
133
  return gr.update(), gr.update(), gr.update()
134
 
135
  def handle_pdb_id_input(pdb_id):
136
- try:
137
- pdb_id = pdb_id.strip().upper()
138
- pdbl = PDBList()
139
- pdbl.retrieve_pdb_file(pdb_id, pdir=TEMP_DIR, file_format='pdb')
140
- pdb_file_path = os.path.join(TEMP_DIR, f"pdb{pdb_id}.ent")
141
- html_out, dd, structure_dict = load_structure(pdb_file_path)
142
- # 删除文件
143
- os.remove(pdb_file_path)
144
- return html_out, dd, structure_dict
145
- except Exception as e:
146
- error_message = f"<b style='color:red'>获取PDB ID {pdb_id} 失败 {e}</b>"
147
- return error_message, gr.update(), gr.update()
148
 
149
  def render_cache(structure_cache):
150
  summary = structure_cache["summary"]
 
133
  return gr.update(), gr.update(), gr.update()
134
 
135
  def handle_pdb_id_input(pdb_id):
136
+ # try:
137
+ pdb_id = pdb_id.strip().upper()
138
+ pdbl = PDBList()
139
+ pdbl.retrieve_pdb_file(pdb_id, pdir=TEMP_DIR, file_format='pdb')
140
+ pdb_file_path = os.path.join(TEMP_DIR, f"pdb{pdb_id}.ent")
141
+ html_out, dd, structure_dict = load_structure(pdb_file_path)
142
+ # 删除文件
143
+ os.remove(pdb_file_path)
144
+ return html_out, dd, structure_dict
145
+ # except Exception as e:
146
+ # error_message = f"<b style='color:red'>获取PDB ID {pdb_id} 失败 {e}</b>"
147
+ # return error_message, gr.update(), gr.update()
148
 
149
  def render_cache(structure_cache):
150
  summary = structure_cache["summary"]