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'):
|
||||
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
|
||||
img = getWikiImage(term)
|
||||
if img:
|
||||
cache[name] = img
|
||||
else:
|
||||
cache[name] = False
|
||||
else:
|
||||
img = cache[name]
|
||||
if img:
|
||||
|
Loading…
Reference in New Issue
Block a user