Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (22 sloc) 0.825 kb
#!/bin/env python
import os
import gzip
import shutil
class FakeTime:
def time(self):
return 1261130520.0
# Hack to override gzip's time implementation
# See: http://stackoverflow.com/questions/264224/setting-the-gzip-timestamp-from-python
gzip.time = FakeTime()
project_dir = 'birdconf'
shutil.rmtree(os.path.join(project_dir, 'gzip'), ignore_errors=True)
shutil.copytree(os.path.join(project_dir, 'assets'), os.path.join(project_dir, 'gzip/assets'))
for path, dirs, files in os.walk(os.path.join(project_dir, 'gzip/assets')):
for filename in files:
file_path = os.path.join(path, filename)
f_in = open(file_path, 'rb')
contents = f_in.readlines()
f_in.close()
f_out = gzip.open(file_path, 'wb')
f_out.writelines(contents)
f_out.close();
Jump to Line
Something went wrong with that request. Please try again.