diff --git a/modules/render.py b/modules/render.py index b446e6f..a4a95b7 100644 --- a/modules/render.py +++ b/modules/render.py @@ -15,14 +15,36 @@ def html(page, json): # This function adds a rendering of the json into the page free = search.is_free(json) - page = page + "\n

" + name = json.get("names",["Unknown"])[0] + page = page + """ + + + + + """ + + page = page + "\n " + page = page + "\n

" try: - page = page + '\nLogo' + page = page + '\n [LOGO] \n' except: pass - name = json.get("names",["Unknown"])[0] - page = page + "\n" + name - page = page + "

" + + page = page + " "+ name +" \n" + page = page + "

\n \n\n" + + page = page + """ + + + + """ # Few words about it comment = json.get("comment","") @@ -34,9 +56,10 @@ def html(page, json): if where == -1: where = comment.lower().find("open-source") ops = comment[where:where+11] - comment = comment.replace(ops, - ""+ops+"") - page = page + "

"+comment+"

" + if ops: + comment = comment.replace(ops, + ""+ops+"") + page = page + "\n

\n "+comment+"\n

\n\n" # I want to show nothing else from if it's proprietary issues_files = list(os.listdir("data/issues")) @@ -59,21 +82,26 @@ def html(page, json): # Links - # - # - # - # - # - # + page = page + """ + + + """ page = page + """ + table, th, td { + border-right:none; + border-left:none; + border-bottom:none; + border-top:none + } + + + + """ page = page + "
CompanyContactCountry
" @@ -84,13 +112,26 @@ def html(page, json): continue link = links[website] page = page + """ - + + + + """ page = page + "
- -
+
+ +
+
" + page = page + """ + + + + """ + # Details categories = {"generic_name":"Features", @@ -128,8 +169,8 @@ def html(page, json): matchtext = "( "+str(matches)+" )" else: matchtext = "" - page = page + "
" - page = page +""+categories[c]+": "+matchtext+"" + page = page + "\n\n
" + page = page +"\n "+categories[c]+": "+matchtext+"" for i in l: matchtext = "" @@ -138,10 +179,29 @@ def html(page, json): matchtext = "    ( match ) " if i+".html" in allfiles: datapage = open("data/"+folder+"/"+i+".html") - page = page + "
    "+matchtext+i+"

"+datapage.read()+"

" + page = page + """ + + + + """ + page = page + "
\n" + page = page + "     "+matchtext+i+"\n" + page = page + " \n

\n" + page = page + " " + datapage.read()+"\n" + page = page + "

\n
\n
" else: - page = page + "    "+matchtext+i+"
" - page = page + "
" + page = page + "\n     "+matchtext+i+"\n
\n" + page = page + """ + + +
+ +
+ + """ return page @@ -150,7 +210,17 @@ def suggestions(page, json): # This function will render suggestions - page = page + "

Free Competitors:

" + page = page + """ + + + +

Free Competitors:

+ + """ found = search.suggest(json) @@ -170,11 +240,28 @@ def suggestions(page, json): frac = 0 if frac < 20 and not more: # Below 40% features match - page = page + """
-

Problematic Competitors:

""" + page = page + """ + + + +
+
+

Problematic Competitors:

+ + """ more = True + + page = page +""" - page = page + "

Suggestion score: " + str(frac) + "%" +
+ + + """ + + page = page + "
Suggestion score: " + str(frac) + "%" page = html(page, i[-1]) if more: @@ -186,12 +273,21 @@ def search_widget(page, address): # Adds a search bar to the page page = page + """ + +
+ + + """ #page = page.format(ADDRESS) @@ -201,15 +297,31 @@ def source_code_link(page): # Adds a source code link - page = page + "


This website is under the GNU AGPL license.

" page = page + """ + + + +
+
+ +
+ +

This website is under the GNU AGPL license.

+ + + + table, th, td { + border-right:none; + border-left:none; + border-bottom:none; + border-top:none + } + + + +
@@ -230,7 +342,16 @@ def source_code_link(page):
-


+ + + + +
+
+ + """ diff --git a/server.py b/server.py index 8e9070c..5baa7af 100644 --- a/server.py +++ b/server.py @@ -88,10 +88,14 @@ class handler(BaseHTTPRequestHandler): self.send_header('Content-type', 'text/html') self.end_headers() - def send(self, text): - text = str(text) + def send(self, textin): + textin = str(textin) csstext = '' - text = ''+csstext+''+text+'' + text = " \n\n" + text = text + "\n" + text = text + ''+csstext+'\n\n' + text = text + "\n" + text = text + '\n\n'+textin+'\n\n'