import urllib import json from utilities import artistLink def replacedict(keys,dbport): response = urllib.request.urlopen("http://localhost:" + str(dbport) + "/issues") db_data = json.loads(response.read()) i = 0 html = "" for d in db_data["duplicates"]: html += "" html += "" html += """""" html += """""" html += "" i += 1 for c in db_data["combined"]: html += "" html += "" html += """""" html += "" i += 1 for n in db_data["newartists"]: html += "" html += "" html += """""" html += "" i += 1 html += "
'" + artistLink(d[0]) + "'" html += " is a possible duplicate of " html += "'" + artistLink(d[1]) + "'""" + d[1] + """ is correct""" + d[0] + """ is correct
'" + artistLink(c[0]) + "' sounds like the combination of " + str(len(c[1])) + " artists: " for a in c[1]: html += "'" + artistLink(a) + "' " html += "Fix it
Is '" + n[0] + "' in '" + artistLink(n[1]) + "' an artist?Yes
" return {"KEY_ISSUESLIST":html,"KEY_ISSUES":str(i)}