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() )
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 )
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 )
def compressCss( md5 ): log.info( "Compress css: " + md5 ) w = YUIWrapper() w.compress( md5 )
def compressJs( md5, externs ): log.info( "Compress js: " + md5 ) w = ClosureWrapper() w.scanExterns( externs ) w.compress( md5 )
def buildClassMap( src, location ): log.info( "Building Class Map" ) c = ClassMap( src ) with open( location, "w" ) as f: f.write( c.build() )