Merge branch 'master' of BezierQuadratic/FreeCompetitors into master
This commit is contained in:
commit
b8fd05de4f
5 changed files with 22 additions and 16 deletions
8
licenses.json
Normal file
8
licenses.json
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"licenses": [
|
||||||
|
"GNU GPL v3.0",
|
||||||
|
"GPL3",
|
||||||
|
"GPL3+",
|
||||||
|
"MIT"
|
||||||
|
]
|
||||||
|
}
|
BIN
modules/__pycache__/render.cpython-310.pyc
Normal file
BIN
modules/__pycache__/render.cpython-310.pyc
Normal file
Binary file not shown.
BIN
modules/__pycache__/search.cpython-310.pyc
Normal file
BIN
modules/__pycache__/search.cpython-310.pyc
Normal file
Binary file not shown.
|
@ -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:
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue