Bug when the description string was in uppercase
This commit is contained in:
parent
fe5aab4f29
commit
5bdc66fd52
1
TODO
1
TODO
|
@ -1,3 +1,4 @@
|
||||||
* HTTPS for all links (grep http:// *.xml)
|
* HTTPS for all links (grep http:// *.xml)
|
||||||
* link to find-subtags
|
* link to find-subtags
|
||||||
* validity HTML and CSS and Atom
|
* validity HTML and CSS and Atom
|
||||||
|
* Google webmaster console
|
|
@ -1,4 +1,4 @@
|
||||||
all:
|
all: ltru.rng
|
||||||
./copy-and-convert.sh
|
./copy-and-convert.sh
|
||||||
cp ./language-subtag-registry-version ..
|
cp ./language-subtag-registry-version ..
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,9 @@ import psycopg2
|
||||||
from yattag import Doc
|
from yattag import Doc
|
||||||
# TODO include the standard elements such as CSS and footer
|
# 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
|
REDIRECTION_URL = "https://www.langtag.net/registries/registry-html" # For
|
||||||
# local testing: Firefox apparently does not accept a redirect to a
|
# local testing: Firefox apparently does not accept a redirect to a
|
||||||
# file.
|
# 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;"
|
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":
|
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;"
|
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
|
found = False
|
||||||
with tag("h1"):
|
with tag("h1"):
|
||||||
text("Results for %s" % form["string"])
|
text("Results for %s" % form["string"])
|
||||||
|
@ -126,3 +129,7 @@ def application(environ, start_response):
|
||||||
# Initialize
|
# Initialize
|
||||||
conn = psycopg2.connect("dbname=lsr")
|
conn = psycopg2.connect("dbname=lsr")
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
httpd = wsgiref.simple_server.make_server("", 4000, application)
|
||||||
|
httpd.serve_forever()
|
||||||
|
|
Loading…
Reference in New Issue