diff --git a/TODO b/TODO index fdf73b6..f346d28 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,4 @@ * HTTPS for all links (grep http:// *.xml) * link to find-subtags * validity HTML and CSS and Atom +* Google webmaster console \ No newline at end of file diff --git a/registries/Makefile b/registries/Makefile index 53214ff..89f0f06 100644 --- a/registries/Makefile +++ b/registries/Makefile @@ -1,4 +1,4 @@ -all: +all: ltru.rng ./copy-and-convert.sh cp ./language-subtag-registry-version .. diff --git a/search.py b/search.py index 84ceb19..26423ed 100755 --- a/search.py +++ b/search.py @@ -12,6 +12,9 @@ import psycopg2 from yattag import Doc # TODO include the standard elements such as CSS and footer +# For testing only: +import wsgiref.simple_server + REDIRECTION_URL = "https://www.langtag.net/registries/registry-html" # For # local testing: Firefox apparently does not accept a redirect to a # file. @@ -105,7 +108,7 @@ def application(environ, start_response): sql = "SELECT Regions.code, Descriptions.description FROM Regions,Descriptions_Regions,Descriptions WHERE Descriptions_Regions.description = Descriptions.id AND Descriptions_Regions.region = Regions.code AND position(%s in lower(Descriptions.description)) > 0;" elif form["what"] == "variant": sql = "SELECT Variants.code, Descriptions.description FROM Variants,Descriptions_Variants,Descriptions WHERE Descriptions_Variants.description = Descriptions.id AND Descriptions_Variants.variant = Variants.code AND position(%s in lower(Descriptions.description)) > 0;" - cursor.execute(sql, (form["string"], )) + cursor.execute(sql, (form["string"].lower(), )) found = False with tag("h1"): text("Results for %s" % form["string"]) @@ -126,3 +129,7 @@ def application(environ, start_response): # Initialize conn = psycopg2.connect("dbname=lsr") cursor = conn.cursor() + +if __name__ == "__main__": + httpd = wsgiref.simple_server.make_server("", 4000, application) + httpd.serve_forever()