Also cache, if a wikipage does not exist
This commit is contained in:
parent
558b9d4eba
commit
e8871f823e
@ -789,11 +789,13 @@ def genScores(G, books, calcPagerank=True):
|
|||||||
|
|
||||||
def addImageToNode(node, cache, shape='circularImage'):
|
def addImageToNode(node, cache, shape='circularImage'):
|
||||||
name = node['label'].split(' (')[0]
|
name = node['label'].split(' (')[0]
|
||||||
if not name in cache:
|
if not name in cache or (cache[name]==False and random.random()<0.05):
|
||||||
term = name
|
term = name
|
||||||
img = getWikiImage(term)
|
img = getWikiImage(term)
|
||||||
if img:
|
if img:
|
||||||
cache[name] = img
|
cache[name] = img
|
||||||
|
else:
|
||||||
|
cache[name] = False
|
||||||
else:
|
else:
|
||||||
img = cache[name]
|
img = cache[name]
|
||||||
if img:
|
if img:
|
||||||
|
Loading…
Reference in New Issue
Block a user