Beispiel #1
0
	def buildClassMap( src, location ):
		log.info( "Building Class Map" )
		c = ClassMap( src )

		os.makedirs( os.path.dirname( location ), exist_ok = True )
		with open( location, "w" ) as f:
			f.write( c.build() )
Beispiel #2
0
	def saveCache( location, content = None, mode = None, externs = "" ):
		if content != None:
			log.info( "Writing file(" +  str( len( content ) ) + "): " + os.path.abspath( location ) )
			with open( location, "w" ) as f:
				f.write( content )

		if mode == "js":
			JWork.compressJs.delay( location, externs )
		elif mode == "css":
			JWork.compressCss( location )
Beispiel #3
0
	def saveCache( location, content = None, mode = None, externs = "" ):
		if content != None:
			log.info( "Writing file(" +  str( len( content ) ) + "): " + os.path.abspath( location ) )
			with open( location, "w" ) as f:
				f.write( content )

		if mode == "js":
			JWork.compressJs.delay( location, externs )
		elif mode == "css":
			JWork.compressCss.delay( location )
Beispiel #4
0
	def compressCss( md5 ):
		log.info( "Compress css: " + md5 )
		w = YUIWrapper()
		w.compress( md5 )
Beispiel #5
0
	def compressJs( md5, externs ):
		log.info( "Compress js: " + md5 )
		w = ClosureWrapper()
		w.scanExterns( externs )
		w.compress( md5 )
Beispiel #6
0
	def buildClassMap( src, location ):
		log.info( "Building Class Map" )
		c = ClassMap( src )

		with open( location, "w" ) as f:
			f.write( c.build() )
Beispiel #7
0
	def compressCss( md5 ):
		log.info( "Compress css: " + md5 )
		w = YUIWrapper()
		w.compress( md5 )
Beispiel #8
0
	def compressJs( md5, externs ):
		log.info( "Compress js: " + md5 )
		w = ClosureWrapper()
		w.scanExterns( externs )
		w.compress( md5 )