OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python3
/
dist-packages
/
wheel
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/17/2025 09:32:20 AM
rwxr-xr-x
📄
__init__.py
96 bytes
09/10/2017 09:52:41 PM
rw-r--r--
📄
__main__.py
419 bytes
07/26/2017 12:20:11 AM
rw-r--r--
📁
__pycache__
-
05/09/2024 06:58:00 AM
rwxr-xr-x
📄
archive.py
2.32 KB
07/29/2017 04:05:11 PM
rw-r--r--
📄
bdist_wheel.py
18.41 KB
08/06/2017 10:02:13 AM
rw-r--r--
📄
decorator.py
541 bytes
07/25/2017 09:21:00 PM
rw-r--r--
📄
egg2wheel.py
2.97 KB
07/26/2017 12:20:11 AM
rw-r--r--
📄
install.py
18 KB
01/23/2023 10:46:47 AM
rw-r--r--
📄
metadata.py
11.29 KB
07/29/2017 04:17:38 PM
rw-r--r--
📄
paths.py
1.1 KB
07/26/2017 12:20:11 AM
rw-r--r--
📄
pep425tags.py
5.63 KB
09/03/2017 02:03:28 PM
rw-r--r--
📄
pkginfo.py
1.23 KB
07/29/2017 03:48:00 PM
rw-r--r--
📁
signatures
-
05/09/2024 06:58:00 AM
rwxr-xr-x
📁
tool
-
05/09/2024 06:58:00 AM
rwxr-xr-x
📄
util.py
4.62 KB
08/06/2017 01:25:31 PM
rw-r--r--
📄
wininst2wheel.py
7.59 KB
07/26/2017 12:20:11 AM
rw-r--r--
Editing: archive.py
Close
""" Archive tools for wheel. """ import os import os.path import time import zipfile from distutils import log def archive_wheelfile(base_name, base_dir): """Archive all files under `base_dir` in a whl file and name it like `base_name`. """ olddir = os.path.abspath(os.curdir) base_name = os.path.abspath(base_name) try: os.chdir(base_dir) return make_wheelfile_inner(base_name) finally: os.chdir(olddir) def make_wheelfile_inner(base_name, base_dir='.'): """Create a whl file from all the files under 'base_dir'. Places .dist-info at the end of the archive.""" zip_filename = base_name + ".whl" log.info("creating '%s' and adding '%s' to it", zip_filename, base_dir) # Some applications need reproducible .whl files, but they can't do this # without forcing the timestamp of the individual ZipInfo objects. See # issue #143. timestamp = os.environ.get('SOURCE_DATE_EPOCH') if timestamp is None: date_time = None else: date_time = time.gmtime(int(timestamp))[0:6] # XXX support bz2, xz when available zip = zipfile.ZipFile(zip_filename, "w", compression=zipfile.ZIP_DEFLATED) score = {'WHEEL': 1, 'METADATA': 2, 'RECORD': 3} deferred = [] def writefile(path, date_time): st = os.stat(path) if date_time is None: mtime = time.gmtime(st.st_mtime) date_time = mtime[0:6] zinfo = zipfile.ZipInfo(path, date_time) zinfo.external_attr = st.st_mode << 16 zinfo.compress_type = zipfile.ZIP_DEFLATED with open(path, 'rb') as fp: zip.writestr(zinfo, fp.read()) log.info("adding '%s'" % path) for dirpath, dirnames, filenames in os.walk(base_dir): # Sort the directory names so that `os.walk` will walk them in a # defined order on the next iteration. dirnames.sort() for name in sorted(filenames): path = os.path.normpath(os.path.join(dirpath, name)) if os.path.isfile(path): if dirpath.endswith('.dist-info'): deferred.append((score.get(name, 0), path)) else: writefile(path, date_time) deferred.sort() for score, path in deferred: writefile(path, date_time) zip.close() return zip_filename