amitness commited on
Commit
9ffe939
1 Parent(s): f4b1cfb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -15,14 +15,14 @@ def convert_tar_to_zip(arxiv_url):
15
  # Fetch the latex source as .tar.gz file
16
  tar_file = requests.get(latex_source_url).content
17
  with tarfile.open(fileobj=io.BytesIO(tar_file)) as tar:
18
- with tempfile.TemporaryDirectory() as dir:
19
  # Extract the tar file to a temporary directory
20
- tar.extractall(dir)
21
 
22
  # Create a zip file from the extracted tar file
23
  filename = str(uuid.uuid4())
24
  zip_name = f'{filename}'
25
- shutil.make_archive(filename, 'zip', dir)
26
 
27
  return {'zip_url': f'{zip_name}.zip'}
28
 
 
15
  # Fetch the latex source as .tar.gz file
16
  tar_file = requests.get(latex_source_url).content
17
  with tarfile.open(fileobj=io.BytesIO(tar_file)) as tar:
18
+ with tempfile.TemporaryDirectory() as temp_dir:
19
  # Extract the tar file to a temporary directory
20
+ tar.extractall(temp_dir)
21
 
22
  # Create a zip file from the extracted tar file
23
  filename = str(uuid.uuid4())
24
  zip_name = f'{filename}'
25
+ shutil.make_archive(filename, 'zip', temp_dir)
26
 
27
  return {'zip_url': f'{zip_name}.zip'}
28