-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
zip_mac.py
36 lines (34 loc) · 983 Bytes
/
zip_mac.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import sys
import logging
from logging import *
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('hey')
logging.info(sys.version)
# import zipfile
# import stat
# import subprocess
# import os
# zip_path = '/Applications/testzip/armada_pipeline.zip'
# zip_dir = '/Applications/testzip'
#
# zf = zipfile.ZipFile(zip_path)
# # print(zf.namelist())
# for file in zf.infolist():
# print(file.filename)
# f = os.path.join(zip_dir, file.filename)
# # exec("chmod u+x " + str())
# # if file.filename == 'armada_pipeline/armada_pipeline':
# # print('adsfadf')
# zf.extract(file, zip_dir)
# # f.chmod(f.stat().st_mode | stat.S_IEXEC)
# subprocess.call(['chmod', 'u+x', f])
# # st = os.stat(file_path)
# # os.chmod(file_path, st.st_mode | 0o111)
# # path = os.path.join(zip_dir, file.filename)
# # os.chmod(path, 0o775)
# # zf.extract(path)
# # zf.extract(file, zip_dir)
#
# zf.close()
# print('done')