Change all tabs to space. somehow we lost this change from tko/ ?
Somewhat scary
Signed-off-by: Martin J. Bligh <mbligh@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@2640 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/tko/query_history.cgi b/tko/query_history.cgi
index b947140..8505293 100755
--- a/tko/query_history.cgi
+++ b/tko/query_history.cgi
@@ -8,56 +8,56 @@
def body():
- db_obj = db.db()
- condition = "uid='%s'" % uid
- where = (condition,[])
- try:
- rows = db_obj.select("time_created,user_comment,url",
- "query_history", where)
- except MySQLdb.ProgrammingError, err:
- print err
- rows = ()
- print '<table border="1">'
- ## Display history starting with the most recent queries
- for row in reversed(rows):
- (time_created, user_comment, tko_url) = row
- print '<tr>'
- print '<td> %s </td>' % time_created
- print '<td> %s </td>' % user_comment
- dict_url = {'delete':time_created}
- link = 'save_query.cgi?' + urllib.urlencode(dict_url)
- print '<td> <a href="%s">Delete</a> </td>' % link
- print '<td><a href="%s">%s</a></td>' % (tko_url, tko_url)
- print '</tr>'
- print '</table>'
+ db_obj = db.db()
+ condition = "uid='%s'" % uid
+ where = (condition,[])
+ try:
+ rows = db_obj.select("time_created,user_comment,url",
+ "query_history", where)
+ except MySQLdb.ProgrammingError, err:
+ print err
+ rows = ()
+ print '<table border="1">'
+ ## Display history starting with the most recent queries
+ for row in reversed(rows):
+ (time_created, user_comment, tko_url) = row
+ print '<tr>'
+ print '<td> %s </td>' % time_created
+ print '<td> %s </td>' % user_comment
+ dict_url = {'delete':time_created}
+ link = 'save_query.cgi?' + urllib.urlencode(dict_url)
+ print '<td> <a href="%s">Delete</a> </td>' % link
+ print '<td><a href="%s">%s</a></td>' % (tko_url, tko_url)
+ print '</tr>'
+ print '</table>'
- last_recorded_query = ''
- if rows:
- (time_created, user_comment, last_recorded_query) = rows[-1]
- ## Link "Back to Autotest" on query history page
- back_link = os.environ.get('HTTP_REFERER')
- ## possible complications:
- ## a) HTTP_REFERER = None
- ## b) HTTP_REFERER is save_query page
- ## In both cases we still want to get to tko results.
- ## primary fall back: link to last_recorded_query
- ## secondary fall back: link to opening tko page
- if not "compose_query.cgi" in str(back_link):
- back_link = last_recorded_query
- if not back_link: ## e.g. history is empty and/or HTTP_REFERER unknown
- back_link = "compose_query.cgi"
- print '<br><a href="%s">Autotest Results</a><br>' % back_link
+ last_recorded_query = ''
+ if rows:
+ (time_created, user_comment, last_recorded_query) = rows[-1]
+ ## Link "Back to Autotest" on query history page
+ back_link = os.environ.get('HTTP_REFERER')
+ ## possible complications:
+ ## a) HTTP_REFERER = None
+ ## b) HTTP_REFERER is save_query page
+ ## In both cases we still want to get to tko results.
+ ## primary fall back: link to last_recorded_query
+ ## secondary fall back: link to opening tko page
+ if not "compose_query.cgi" in str(back_link):
+ back_link = last_recorded_query
+ if not back_link: ## e.g. history is empty and/or HTTP_REFERER unknown
+ back_link = "compose_query.cgi"
+ print '<br><a href="%s">Autotest Results</a><br>' % back_link
def main():
- print "Content-type: text/html\n"
- print
- # create the actual page
- print '<html><head><title>'
- print 'History of TKO usage'
- print '</title></head><body>'
- body()
- print '</body></html>'
+ print "Content-type: text/html\n"
+ print
+ # create the actual page
+ print '<html><head><title>'
+ print 'History of TKO usage'
+ print '</title></head><body>'
+ body()
+ print '</body></html>'
main()