Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix in form

git-svn-id: http://svn.matienzo.org/public/python/zgw@402 9bbe1849-123c-0410-9313-83ec163a5258
  • Loading branch information...
commit 458e7649fcfd2890013ba96852d4cc74121fe573 1 parent 4cfa766
@anarchivist authored
Showing with 12 additions and 9 deletions.
  1. +2 −2 templates/base.html
  2. +4 −4 templates/usage.html
  3. +6 −3 zgw.py
View
4 templates/base.html
@@ -4,9 +4,9 @@
<title>zgw.py</title>
</head>
<body>
- <h1>zgw.py: a lightweight z39.50 web gateway</h1>
+ <h1><a href="/zgw/">zgw.py</a>: a lightweight z39.50 web gateway</h1>
<p>currently searching database $server['db'] on $server['host']<br/>
query syntax: $QUERY_SYNTAX / result syntax: $RESULT_SYNTAX</p>
- <form method="post" action="query">
+ <form method="post" action="/query">
<p><input type="text" name="query_string"/><input type="submit" value="submit"/></p>
</form>
View
8 templates/usage.html
@@ -1,8 +1,8 @@
<h2>usage:</h2>
- <p>either use the form (see below for syntax) or GET your query from /search/&lt;query_string&gt;. examples (in CCL syntax):
- <ul><li>author: <a href='search/au="van rossum, guido"'>au="van rossum, guido"</a></li>
- <li>title: <a href='search/ti="henriette d. avram retirement program"'>ti="henriette d. avram retirement program"</a></li>
- <li>keyword + boolean: <a href='search/zettel and wittgenstein'>zettel and wittgenstein</a></li></ul>
+ <p>either use the form (see below for syntax) or GET your query from /zgw/search/&lt;query_string&gt;. examples (in CCL syntax):
+ <ul><li>author: <a href='/search/au="van rossum, guido"'>au="van rossum, guido"</a></li>
+ <li>title: <a href='/search/ti="henriette d. avram retirement program"'>ti="henriette d. avram retirement program"</a></li>
+ <li>keyword + boolean: <a href='/search/("blue book" or "blaue buch") and wittgenstein">zettel and wittgenstein</a></li></ul>
</p>
</body>
</html>
View
9 zgw.py
@@ -45,7 +45,8 @@ def run_query(server, qs):
class search:
"""web.py class for submitting a Z39.50 query and returning results"""
def GET(self, query_string):
- print render.base(server=SERVER, RESULT_SYNTAX=RESULT_SYNTAX, QUERY_SYNTAX=QUERY_SYNTAX)
+ print render.base(server=SERVER, RESULT_SYNTAX=RESULT_SYNTAX,
+ QUERY_SYNTAX=QUERY_SYNTAX)
results = run_query(SERVER, query_string)
print render.search(query_string=query_string, results=results,
total=len(results))
@@ -53,7 +54,8 @@ def GET(self, query_string):
def POST(self):
i = web.input()
query_string = i.query_string
- print render.base(server=SERVER, RESULT_SYNTAX=RESULT_SYNTAX, QUERY_SYNTAX=QUERY_SYNTAX)
+ print render.base(server=SERVER, RESULT_SYNTAX=RESULT_SYNTAX,
+ QUERY_SYNTAX=QUERY_SYNTAX)
results = run_query(SERVER, query_string)
print render.search(query_string=query_string, results=results,
total=len(results))
@@ -61,7 +63,8 @@ def POST(self):
class usage:
"""web.py class to display usage information"""
def GET(self):
- print render.base(server=SERVER, RESULT_SYNTAX=RESULT_SYNTAX, QUERY_SYNTAX=QUERY_SYNTAX)
+ print render.base(server=SERVER, RESULT_SYNTAX=RESULT_SYNTAX,
+ QUERY_SYNTAX=QUERY_SYNTAX)
print render.usage()
web.webapi.internalerror = web.debugerror
Please sign in to comment.
Something went wrong with that request. Please try again.