Do not rebuild .c.* files if cache exists

This commit is contained in:
斟酌 鵬兄 2022-08-03 01:20:17 +09:00
parent a7c8c4dc84
commit 39b6d34376

View File

@ -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,10 +204,14 @@ 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 ):
if self.useCache( oFile ):
if not cCached:
self.JWork.saveCache(
oFile
# Content is None to initiate a compression
@ -222,6 +222,8 @@ class BotanClassResolver:
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 = "/* @ */"