#NEWLINE# def _process_bundle( self , name , paths , type ) : #NEWLINE# #INDENT# ( sha1 , opt_dash ) = ( '' , '' ) #NEWLINE# raw_data = [ open ( path ) . read ( ) for path in paths ] #NEWLINE# if self . config . get ( 'fingerprint' ) : #NEWLINE# #INDENT# sha1 = hashlib . sha1 ( '' . join ( raw_data ) ) . hexdigest ( ) #NEWLINE# opt_dash = '-' #NEWLINE# #UNINDENT# file_ext = { #NEWLINE# #INDENT# 'javascript' : '.js' , #NEWLINE# 'css' : '.css' , #NEWLINE# #UNINDENT# } . get ( type ) #NEWLINE# fname_template = ( '%s%s%s{suffix}%s{gz}' % ( name , opt_dash , sha1 , file_ext ) ) #NEWLINE# concat_fname = fname_template . format ( suffix = '' , gz = '' ) #NEWLINE# concat_data = self . _concat ( raw_data , type ) #NEWLINE# self . write ( concat_fname , concat_data ) #NEWLINE# minified_fname = fname_template . format ( suffix = '.min' , gz = '' ) #NEWLINE# minified_data = self . _minify ( raw_data , type , paths = paths ) #NEWLINE# self . write ( minified_fname , minified_data ) #NEWLINE# gzipped_fname = fname_template . format ( suffix = '.min' , gz = '.gz' ) #NEWLINE# gzipped_data = self . _compress ( minified_data ) #NEWLINE# self . write ( gzipped_fname , gzipped_data ) #NEWLINE# return { #NEWLINE# #INDENT# name : { #NEWLINE# #INDENT# 'files' : [ os . path . relpath ( p , self . basedir ) for p in paths ] , #NEWLINE# 'fingerprint' : sha1 , #NEWLINE# 'output' : { #NEWLINE# #INDENT# 'raw' : concat_fname , #NEWLINE# 'min' : minified_fname , #NEWLINE# 'gz' : gzipped_fname , #NEWLINE# #UNINDENT# } , #NEWLINE# 'size' : { #NEWLINE# #INDENT# 'raw' : len ( concat_data ) , #NEWLINE# 'min' : len ( minified_data ) , #NEWLINE# 'gz' : len ( gzipped_data ) , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# }