Removed print()s
This commit is contained in:
parent
3f2b0a1a0f
commit
1faa1ce108
2 changed files with 3 additions and 9 deletions
|
@ -115,20 +115,14 @@ def suggestions(page, json):
|
||||||
|
|
||||||
page = page + "<br><br><h1>Replacements:</h1><br><br>"
|
page = page + "<br><br><h1>Replacements:</h1><br><br>"
|
||||||
|
|
||||||
print("json request")
|
|
||||||
|
|
||||||
found = search.suggest(json)
|
found = search.suggest(json)
|
||||||
print("json received", len(found))
|
|
||||||
|
|
||||||
for i in found:
|
for i in found:
|
||||||
|
|
||||||
print(i[-1].get("names",["no name"])[0], "Drawing")
|
|
||||||
|
|
||||||
free = False
|
free = False
|
||||||
if "licenses" in i[-1] and i[-1]["licenses"]:
|
if "licenses" in i[-1] and i[-1]["licenses"]:
|
||||||
free = True
|
free = True
|
||||||
|
|
||||||
print(i[-1].get("names", ["nothing"])[0])
|
|
||||||
if not i[0] or i[-1] == json or not free:
|
if not i[0] or i[-1] == json or not free:
|
||||||
continue
|
continue
|
||||||
page = page + "<br><br>"
|
page = page + "<br><br>"
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from difflib import SequenceMatcher
|
from difflib import SequenceMatcher # checks how similar are two strings
|
||||||
|
|
||||||
def similar(a, b):
|
def similar(a, b):
|
||||||
# I guess it simpifies the syntax for SequenceMatcher
|
# I guess it simpifies the syntax for SequenceMatcher
|
||||||
|
@ -86,7 +86,7 @@ def suggest(json_data):
|
||||||
for b in json_data.get(c, []):
|
for b in json_data.get(c, []):
|
||||||
if b in i.get(c, []):
|
if b in i.get(c, []):
|
||||||
score += 1
|
score += 1
|
||||||
print(score, i.get("names",["no name"])[0], "SCORE")
|
|
||||||
found.append([score, i])
|
found.append([score, i])
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue