Upload files to ''
This commit is contained in:
parent
46a9130e41
commit
f204444115
1 changed files with 9 additions and 15 deletions
24
server.py
24
server.py
|
@ -49,13 +49,12 @@ class handler(BaseHTTPRequestHandler):
|
||||||
if self.path == "/":
|
if self.path == "/":
|
||||||
|
|
||||||
# If the user is at the front page, let him get only the search bar
|
# If the user is at the front page, let him get only the search bar
|
||||||
|
|
||||||
self.send("""
|
page = ""
|
||||||
<form action="/search" method="GET">
|
page = render.search_widget(page)
|
||||||
<input type="text" name="item" class="search" placeholder="Name of Software">
|
page = page + "<p>Please search for any software to which you would like to find a Free Software replacement.</p>"
|
||||||
<input type="submit" value="Search">
|
page = render.source_code_link(page)
|
||||||
</form>
|
self.send(page)
|
||||||
""")
|
|
||||||
|
|
||||||
elif "/search?item=" in self.path:
|
elif "/search?item=" in self.path:
|
||||||
|
|
||||||
|
@ -73,18 +72,13 @@ class handler(BaseHTTPRequestHandler):
|
||||||
software = self.path.replace("/", "").replace("+", " ")
|
software = self.path.replace("/", "").replace("+", " ")
|
||||||
|
|
||||||
software_data = search.search_app(software)
|
software_data = search.search_app(software)
|
||||||
page = """
|
page = ""
|
||||||
<form action="/search" method="GET">
|
page = render.search_widget(page)
|
||||||
<input type="text" name="item" class="search" placeholder="Name of Software">
|
|
||||||
<input type="submit" value="Search">
|
|
||||||
</form>
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
# Let's add the found software to the page
|
# Let's add the found software to the page
|
||||||
page = render.html(page, software_data)
|
page = render.html(page, software_data)
|
||||||
page = render.suggestions(page, software_data)
|
page = render.suggestions(page, software_data)
|
||||||
|
page = render.source_code_link(page)
|
||||||
|
|
||||||
self.send(page)
|
self.send(page)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue