22 lines
697 B
Python
22 lines
697 B
Python
import os
|
|
import wmill
|
|
from zipfile import ZipFile
|
|
|
|
# You can import any PyPi package.
|
|
# See here for more info: https://www.windmill.dev/docs/advanced/dependencies_in_python
|
|
|
|
# you can use typed resources by doing a type alias to dict
|
|
#postgresql = dict
|
|
|
|
def main(download_success):
|
|
unzip_success = {}
|
|
for zip_name, success in download_success.items():
|
|
if success:
|
|
file_name = zip_name.replace('.zip', '')
|
|
file_path = f'./shared/{file_name}'
|
|
zip_path = f'./shared/{zip_name}'
|
|
with ZipFile(zip_path, 'r') as zip_ref:
|
|
zip_ref.extractall(file_path)
|
|
unzip_success[file_name] = True
|
|
|
|
return unzip_success |