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