mirror of https://gitlab.com/bashrc2/epicyon
Less indentation
parent
55c351e8a6
commit
df7d650b5b
13
cache.py
13
cache.py
|
@ -66,12 +66,13 @@ def storePersonInCache(baseDir: str, personUrl: str,
|
||||||
return
|
return
|
||||||
|
|
||||||
# store to file
|
# store to file
|
||||||
if allowWriteToFile:
|
if not allowWriteToFile:
|
||||||
if os.path.isdir(baseDir+'/cache/actors'):
|
return
|
||||||
cacheFilename = baseDir + '/cache/actors/' + \
|
if os.path.isdir(baseDir+'/cache/actors'):
|
||||||
personUrl.replace('/', '#')+'.json'
|
cacheFilename = baseDir + '/cache/actors/' + \
|
||||||
if not os.path.isfile(cacheFilename):
|
personUrl.replace('/', '#')+'.json'
|
||||||
saveJson(personJson, cacheFilename)
|
if not os.path.isfile(cacheFilename):
|
||||||
|
saveJson(personJson, cacheFilename)
|
||||||
|
|
||||||
|
|
||||||
def getPersonFromCache(baseDir: str, personUrl: str, personCache: {},
|
def getPersonFromCache(baseDir: str, personUrl: str, personCache: {},
|
||||||
|
|
|
@ -161,7 +161,7 @@ def _saveIndividualPostAsHtmlToCache(baseDir: str,
|
||||||
fp.write(postHtml)
|
fp.write(postHtml)
|
||||||
return True
|
return True
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print('ERROR: saving post to cache ' + str(e))
|
print('ERROR: saving post to cache, ' + str(e))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue