barunsaha commited on
Commit
1189403
1 Parent(s): 2605d55

Close temp files after opening

Browse files
Files changed (3) hide show
  1. app.py +3 -0
  2. helpers/pptx_helper.py +2 -0
  3. legacy_app.py +3 -0
app.py CHANGED
@@ -254,6 +254,9 @@ def generate_slide_deck(json_str: str):
254
  st.session_state[DOWNLOAD_FILE_KEY] = str(path)
255
  logger.debug('DOWNLOAD_FILE_KEY not found in session')
256
 
 
 
 
257
  logger.debug('Creating PPTX file: %s...', st.session_state[DOWNLOAD_FILE_KEY])
258
 
259
  try:
 
254
  st.session_state[DOWNLOAD_FILE_KEY] = str(path)
255
  logger.debug('DOWNLOAD_FILE_KEY not found in session')
256
 
257
+ if temp:
258
+ temp.close()
259
+
260
  logger.debug('Creating PPTX file: %s...', st.session_state[DOWNLOAD_FILE_KEY])
261
 
262
  try:
helpers/pptx_helper.py CHANGED
@@ -241,3 +241,5 @@ if __name__ == '__main__':
241
  output_file_path=path,
242
  slides_template='Blank'
243
  )
 
 
 
241
  output_file_path=path,
242
  slides_template='Blank'
243
  )
244
+
245
+ temp.close()
legacy_app.py CHANGED
@@ -241,6 +241,9 @@ def generate_slide_deck(json_str: str, pptx_template: str, progress_bar) -> List
241
  with open(path, 'rb') as f:
242
  st.download_button('Download PPTX file', f, file_name='Presentation.pptx')
243
 
 
 
 
244
  return all_headers
245
 
246
 
 
241
  with open(path, 'rb') as f:
242
  st.download_button('Download PPTX file', f, file_name='Presentation.pptx')
243
 
244
+ if temp:
245
+ temp.close()
246
+
247
  return all_headers
248
 
249