added gzipbuilder (for manpages)
This commit is contained in:
parent
4f9d09264d
commit
a7dfc54f85
|
|
@ -12,6 +12,10 @@ EFENCE=False
|
||||||
|
|
||||||
env = Environment(CPPPATH='#/include', LIBPATH=['/usr/lib','/usr/local/lib'])
|
env = Environment(CPPPATH='#/include', LIBPATH=['/usr/lib','/usr/local/lib'])
|
||||||
|
|
||||||
|
# Import GZip builder
|
||||||
|
import gzipBuilder
|
||||||
|
env['BUILDERS']['GZip']=Builder(action=gzipBuilder.GZip)
|
||||||
|
|
||||||
#import environment
|
#import environment
|
||||||
from importer import importEnvironment,importVariable
|
from importer import importEnvironment,importVariable
|
||||||
importEnvironment(env,'HOME')
|
importEnvironment(env,'HOME')
|
||||||
|
|
|
||||||
33
site_scons/gzipBuilder.py
Normal file
33
site_scons/gzipBuilder.py
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
#
|
||||||
|
# GZip SCons builder
|
||||||
|
#
|
||||||
|
# Version 1.0
|
||||||
|
# 16-Jun-2009
|
||||||
|
#
|
||||||
|
|
||||||
|
def GZip(target, source, env=None):
|
||||||
|
"""Compress files with gzip using default compression level.
|
||||||
|
|
||||||
|
Compress source files into target files using gzip
|
||||||
|
compression. No checking on datestamps of possible existing
|
||||||
|
target file is done, its always overwritten.
|
||||||
|
|
||||||
|
Keyword arguments:
|
||||||
|
target -- list of compressed files to made
|
||||||
|
source -- list of files to be compressed
|
||||||
|
env -- SCons environment (not used)
|
||||||
|
"""
|
||||||
|
import gzip
|
||||||
|
if not isinstance(target, list):
|
||||||
|
raise TypeError,"target must be list"
|
||||||
|
elif not isinstance(source, list):
|
||||||
|
raise TypeError,"source must be list"
|
||||||
|
for i in range(0,len(target)):
|
||||||
|
inpf=str(source[i])
|
||||||
|
outf=str(target[i])
|
||||||
|
out=gzip.open(outf,"wb")
|
||||||
|
inp=file(inpf,"rb")
|
||||||
|
out.write(inp.read())
|
||||||
|
out.close()
|
||||||
|
inp.close()
|
||||||
|
return None
|
||||||
Loading…
Reference in New Issue
Block a user