forked from Botanical/BotanJS
Do not rebuild .c.* files if cache exists
This commit is contained in:
parent
a7c8c4dc84
commit
39b6d34376
@ -44,7 +44,7 @@ class Resolver:
|
||||
|
||||
parent = self.parentMap[ elem ]
|
||||
|
||||
if parent != None:
|
||||
if parent is not None:
|
||||
return self.resource( parent )
|
||||
|
||||
def locate( self, key ):
|
||||
@ -190,10 +190,6 @@ class BotanClassResolver:
|
||||
cssGroup.sort( key = lambda x : x[ "src" ] )
|
||||
cssList.extend( cssGroup )
|
||||
|
||||
for k in cssList:
|
||||
print( k[ "src" ] )
|
||||
|
||||
|
||||
def getCache( self, fileList, cName, mode ):
|
||||
if self.CR == None:
|
||||
return None
|
||||
@ -208,20 +204,26 @@ class BotanClassResolver:
|
||||
# Compressed file
|
||||
cFile = os.path.join( self.CR, cFHash )
|
||||
|
||||
if self.flagCompress and self.useCache( cFile ):
|
||||
cCached = self.useCache( cFile )
|
||||
|
||||
if self.flagCompress and cCached:
|
||||
return self.BotanCache( cFile, cFHash, self.returnDynamic )
|
||||
|
||||
elif self.useCache( oFile ):
|
||||
self.JWork.saveCache(
|
||||
oFile
|
||||
# Content is None to initiate a compression
|
||||
, None
|
||||
, mode
|
||||
, os.path.join( self.R, "externs" )
|
||||
)
|
||||
if self.useCache( oFile ):
|
||||
|
||||
if not cCached:
|
||||
self.JWork.saveCache(
|
||||
oFile
|
||||
# Content is None to initiate a compression
|
||||
, None
|
||||
, mode
|
||||
, os.path.join( self.R, "externs" )
|
||||
)
|
||||
|
||||
return self.BotanCache( oFile, oFHash, False )
|
||||
|
||||
return None
|
||||
|
||||
def useCache( self, f ):
|
||||
return os.path.exists( f )
|
||||
|
||||
@ -233,7 +235,7 @@ class BotanClassResolver:
|
||||
|
||||
cacheFile = self.getCache( cList, md5, "js" )
|
||||
|
||||
if cacheFile != None:
|
||||
if cacheFile is not None:
|
||||
return cacheFile;
|
||||
|
||||
# The root file
|
||||
@ -279,7 +281,7 @@ class BotanClassResolver:
|
||||
md5 = [ None ]
|
||||
cacheFile = self.getCache( cList, md5, "css" )
|
||||
|
||||
if cacheFile != None:
|
||||
if cacheFile is not None:
|
||||
return cacheFile;
|
||||
|
||||
struct = "/* @ */"
|
||||
|
Loading…
Reference in New Issue
Block a user