forked from Botanical/BotanJS
Better caching mechanics
This commit is contained in:
@@ -4,11 +4,11 @@ import os
|
||||
from sys import platform
|
||||
from tempfile import NamedTemporaryFile
|
||||
from botanjs.config import Config as config
|
||||
from botanjs.service.jwork import log
|
||||
|
||||
COMPILER = config[ "BotanJS" ][ "ClosureCompiler" ]
|
||||
|
||||
if not os.path.isfile( COMPILER ):
|
||||
raise Exception( "Compiler not found" )
|
||||
AVAILABLE = os.path.isfile( COMPILER )
|
||||
|
||||
|
||||
COMPILER_OPTIONS = [
|
||||
@@ -42,6 +42,11 @@ class Wrapper:
|
||||
break
|
||||
|
||||
def compress( self, loc ):
|
||||
|
||||
if not AVAILABLE:
|
||||
log.error( "Compiler not found" )
|
||||
return
|
||||
|
||||
content = ""
|
||||
with open( loc, "rb" ) as f:
|
||||
content = f.read()
|
||||
|
Reference in New Issue
Block a user