Skip to content

Commit

Permalink
Increase GZIP compression level
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartpittaway committed Dec 27, 2023
1 parent 822a4f1 commit cbe2f33
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ESPController/prebuild_compress.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

def prepare_www_files():
# WARNING - this script will DELETE your 'data' dir and recreate an empty one to copy/gzip files from 'data_src'
# so make sure to edit your files in 'data_src' folder as changes madt to files in 'data' woll be LOST
# so make sure to edit your files in 'data_src' folder as changes madt to files in 'data' will be LOST
#
# If 'data_src' dir doesn't exist, and 'data' dir is found, the script will autimatically
# If 'data_src' dir doesn't exist, and 'data' dir is found, the script will automatically
# rename 'data' to 'data_src

# add filetypes (extensions only) to be gzipped before uploading. Everything else will be copied directly
Expand Down Expand Up @@ -65,7 +65,7 @@ def prepare_www_files():

for file in files_to_gzip:
print(' GZipping file: ' + file + ' to data dir')
with open(file, 'rb') as f_in, gzip.open(os.path.join(data_dir, os.path.basename(file) + '.gz'), 'wb') as f_out:
with open(file, 'rb') as f_in, gzip.GzipFile(filename=os.path.join(data_dir, os.path.basename(file) + '.gz'), mode='w', compresslevel=9) as f_out:
shutil.copyfileobj(f_in, f_out)

print('[/COPY/GZIP DATA FILES]')
Expand Down

0 comments on commit cbe2f33

Please sign in to comment.