Spaces:
Running
Running
Update app.py
Browse files
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
|
19 |
# Extract the tar file to a temporary directory
|
20 |
-
tar.extractall(
|
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',
|
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 |
|