Merge branch 'master' of BezierQuadratic/FreeCompetitors into master

This commit is contained in:
Jeison Yehuda Amihud (Blender Dumbass) 2022-04-02 06:29:58 +00:00 committed by Gogs
commit b8fd05de4f
5 changed files with 22 additions and 16 deletions

8
licenses.json Normal file
View file

@ -0,0 +1,8 @@
{
"licenses": [
"GNU GPL v3.0",
"GPL3",
"GPL3+",
"MIT"
]
}

Binary file not shown.

Binary file not shown.

View file

@ -7,16 +7,13 @@
# your ability to set it up and running. # your ability to set it up and running.
from modules import search from modules import search
import json
def html(page, json): def html(page, json):
# This function adds a rendering of the json into the page # This function adds a rendering of the json into the page
free = search.is_free(json) free = search.is_free(json)
page = page + "\n <h1>" page = page + "\n <h1>"
try: try:
page = page + '\n<img src="'+ json["links"]["icon"] + '" alt="Logo" style="width:50px;">' page = page + '\n<img src="'+ json["links"]["icon"] + '" alt="Logo" style="width:50px;">'
@ -118,7 +115,6 @@ def suggestions(page, json):
biggest = i[0] biggest = i[0]
for i in found: for i in found:
free = search.is_free(i[-1]) free = search.is_free(i[-1])
if not i[0] or i[-1] == json or not free: if not i[0] or i[-1] == json or not free:

View file

@ -101,14 +101,16 @@ def suggest(json_data):
return found return found
def is_free(data): def is_free(app):
if "licenses" in app and app["licenses"]:
# TODO: Add a more complex algorithm of checking if software is matches = 0
# free or not. There are plenty of semi-free software like with open("licenses.json", "r") as data:
# Unreal Engine. They have licenses but they do not give the users all_licenses = json.load(data)
# the four essential freedoms. for license in app["licenses"]:
for license2 in all_licenses["licenses"]:
free = False if license2 == license:
if "licenses" in data and data["licenses"]: matches = matches + 1
free = True break
return free if matches == len(app["licenses"]):
return True
return False