From 1faa1ce10896d52d60fa57ed5547f07c44283eb3 Mon Sep 17 00:00:00 2001 From: "Jeison Yehuda Amihud (Blender Dumbass)" Date: Wed, 30 Mar 2022 17:52:36 +0000 Subject: [PATCH] Removed print()s --- modules/render.py | 8 +------- modules/search.py | 4 ++-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/modules/render.py b/modules/render.py index 51c37c6..66c8914 100644 --- a/modules/render.py +++ b/modules/render.py @@ -114,21 +114,15 @@ def suggestions(page, json): # This function will render suggestions page = page + "

Replacements:



" - - print("json request") found = search.suggest(json) - print("json received", len(found)) for i in found: - - print(i[-1].get("names",["no name"])[0], "Drawing") free = False if "licenses" in i[-1] and i[-1]["licenses"]: free = True - - print(i[-1].get("names", ["nothing"])[0]) + if not i[0] or i[-1] == json or not free: continue page = page + "

" diff --git a/modules/search.py b/modules/search.py index c9da638..690a348 100644 --- a/modules/search.py +++ b/modules/search.py @@ -8,7 +8,7 @@ import os import json -from difflib import SequenceMatcher +from difflib import SequenceMatcher # checks how similar are two strings def similar(a, b): # I guess it simpifies the syntax for SequenceMatcher @@ -86,7 +86,7 @@ def suggest(json_data): for b in json_data.get(c, []): if b in i.get(c, []): score += 1 - print(score, i.get("names",["no name"])[0], "SCORE") + found.append([score, i]) try: