From 45a7da3ce181b94927c1e8e0c45069ca92c18b1f Mon Sep 17 00:00:00 2001 From: jadmanski Date: Thu, 1 May 2008 22:22:51 +0000 Subject: Convert tko/*.cgi to use absolute imports, to resolve some ambiguity with importing "frontend". Signed-off-by: John Admanski git-svn-id: svn://test.kernel.org/autotest/trunk@1482 592f7852-d20e-0410-864c-8624ca9c26a4 --- tko/compose_query.cgi | 20 ++++++++------------ tko/machine_aggr.cgi | 9 +++------ tko/machine_benchmark.cgi | 5 ++--- tko/machine_test_attribute_graph.cgi | 9 +++------ tko/test.cgi | 5 ++--- 5 files changed, 18 insertions(+), 30 deletions(-) (limited to 'tko') diff --git a/tko/compose_query.cgi b/tko/compose_query.cgi index 4e94d52a..e21edfde 100755 --- a/tko/compose_query.cgi +++ b/tko/compose_query.cgi @@ -7,18 +7,14 @@ in the matrix. """ print "Content-type: text/html\n" -import cgi, cgitb, re, datetime, query_lib, time -import sys, os -import urllib - -total_wall_time_start = time.time(); -tko = os.path.dirname(os.path.realpath(os.path.abspath(sys.argv[0]))) -sys.path.insert(0, tko) - -import display, frontend, db, query_lib -client_bin = os.path.abspath(os.path.join(tko, '../client/bin')) -sys.path.insert(0, client_bin) -import kernel_versions + +import sys, os, urllib, cgi, cgitb, re, datetime, time + +total_wall_time_start = time.time() + +import common +from autotest_lib.tko import display, frontend, db, query_lib +from autotest_lib.client.bin import kernel_versions html_header = """\
diff --git a/tko/machine_aggr.cgi b/tko/machine_aggr.cgi index 5c23644c..ea8009e7 100644 --- a/tko/machine_aggr.cgi +++ b/tko/machine_aggr.cgi @@ -6,12 +6,9 @@ import cgi, cgitb, os, sys, re, subprocess cgitb.enable() Popen = subprocess.Popen -tko = os.path.dirname(os.path.realpath(os.path.abspath(sys.argv[0]))) -sys.path.insert(0, tko) -import db, display, frontend, plotgraph -client_bin = os.path.abspath(os.path.join(tko, '../client/bin')) -sys.path.insert(0, client_bin) -import kernel_versions +import common +from autotest_lib.tko import db, display, frontend, plotgraph +from autotest_lib.client.bin import kernel_versions released_kernel = re.compile('2\.\d\.\d+(-smp-)[0-9]{3}\.[0-9]$') rc_kernel = re.compile('2\.\d\.\d+(-smp-)[0-9]{3}\.[0-9]_rc[0-9]$') diff --git a/tko/machine_benchmark.cgi b/tko/machine_benchmark.cgi index d0b1aef0..0c7bc7d9 100755 --- a/tko/machine_benchmark.cgi +++ b/tko/machine_benchmark.cgi @@ -4,9 +4,8 @@ import cgi, cgitb, os, sys, re sys.stdout.flush() cgitb.enable() -tko = os.path.dirname(os.path.realpath(os.path.abspath(sys.argv[0]))) -sys.path.insert(0, tko) -import db, display, frontend +import common +from autotest_lib.tko import db, display, frontend db = db.db() diff --git a/tko/machine_test_attribute_graph.cgi b/tko/machine_test_attribute_graph.cgi index 8a16a6b6..2d5a4779 100755 --- a/tko/machine_test_attribute_graph.cgi +++ b/tko/machine_test_attribute_graph.cgi @@ -6,12 +6,9 @@ import cgi, cgitb, os, sys, re, subprocess cgitb.enable() Popen = subprocess.Popen -tko = os.path.dirname(os.path.realpath(os.path.abspath(sys.argv[0]))) -sys.path.insert(0, tko) -import db, display, frontend, plotgraph -client_bin = os.path.abspath(os.path.join(tko, '../client/bin')) -sys.path.insert(0, client_bin) -import kernel_versions +import common +from autotest_lib.tko import db, display, frontend, plotgraph +from autotest_lib.client.bin import kernel_versions db = db.db() diff --git a/tko/test.cgi b/tko/test.cgi index d96d82f5..a1597ae4 100644 --- a/tko/test.cgi +++ b/tko/test.cgi @@ -9,9 +9,8 @@ import cgi, cgitb, os, sys, re sys.stdout.flush() cgitb.enable() -tko = os.path.dirname(os.path.realpath(os.path.abspath(sys.argv[0]))) -sys.path.insert(0, tko) -import db, display, frontend +import common +from autotest_lib.tko import db, display, frontend db = db.db() -- cgit v1.2.3