[LNT] r307710 - lnttool: Fix pep8 warnings
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 11 13:58:36 PDT 2017
Author: matze
Date: Tue Jul 11 13:58:36 2017
New Revision: 307710
URL: http://llvm.org/viewvc/llvm-project?rev=307710&view=rev
Log:
lnttool: Fix pep8 warnings
Modified:
lnt/trunk/lnt/lnttool/convert.py
lnt/trunk/lnt/lnttool/create.py
lnt/trunk/lnt/lnttool/import_data.py
lnt/trunk/lnt/lnttool/import_report.py
lnt/trunk/lnt/lnttool/main.py
lnt/trunk/lnt/lnttool/updatedb.py
Modified: lnt/trunk/lnt/lnttool/convert.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/lnttool/convert.py?rev=307710&r1=307709&r2=307710&view=diff
==============================================================================
--- lnt/trunk/lnt/lnttool/convert.py (original)
+++ lnt/trunk/lnt/lnttool/convert.py Tue Jul 11 13:58:36 2017
@@ -17,6 +17,7 @@ def convert_data(input, output, inFormat
out['write'](data, output)
output.flush()
+
@click.command("convert")
@click.argument("input", type=click.File('rb'), default="-", required=False)
@click.argument("output", type=click.File('wb'), default="-", required=False)
Modified: lnt/trunk/lnt/lnttool/create.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/lnttool/create.py?rev=307710&r1=307709&r2=307710&view=diff
==============================================================================
--- lnt/trunk/lnt/lnttool/create.py (original)
+++ lnt/trunk/lnt/lnttool/create.py Tue Jul 11 13:58:36 2017
@@ -27,12 +27,12 @@ name = %(name)r
# provide an absolute URL to the server.
zorgURL = %(hosturl)r
-# Temporary directory, for use by the web app. This must be writable by the user
-# the web app runs as.
+# Temporary directory, for use by the web app. This must be writable by the
+# user the web app runs as.
tmp_dir = %(tmp_dir)r
-# Database directory, for easily rerooting the entire set of databases. Database
-# paths are resolved relative to the config path + this path.
+# Database directory, for easily rerooting the entire set of databases.
+# Database paths are resolved relative to the config path + this path.
db_dir = %(db_dir)r
# Profile directory, where profiles are kept.
@@ -137,7 +137,7 @@ LNT configuration.
basepath = os.path.abspath(instance_path)
if os.path.exists(basepath):
- raise SystemExit,"error: invalid path: %r already exists" % basepath
+ raise SystemExit("error: invalid path: %r already exists" % basepath)
hosturl = "http://%s/%s" % (hostname, hostsuffix)
Modified: lnt/trunk/lnt/lnttool/import_data.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/lnttool/import_data.py?rev=307710&r1=307709&r2=307710&view=diff
==============================================================================
--- lnt/trunk/lnt/lnttool/import_data.py (original)
+++ lnt/trunk/lnt/lnttool/import_data.py Tue Jul 11 13:58:36 2017
@@ -59,4 +59,4 @@ def action_import(instance_path, files,
verbose)
if not success:
- raise SystemExit, 1
+ raise SystemExit(1)
Modified: lnt/trunk/lnt/lnttool/import_report.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/lnttool/import_report.py?rev=307710&r1=307709&r2=307710&view=diff
==============================================================================
--- lnt/trunk/lnt/lnttool/import_report.py (original)
+++ lnt/trunk/lnt/lnttool/import_report.py Tue Jul 11 13:58:36 2017
@@ -26,9 +26,8 @@ def action_importreport(input, output, s
bar.size 456
foo/bar/baz.size 789
- The format is "test-name.metric", so exec and size are valid metrics for the
- test suite you are submitting to.
- to.
+ The format is "test-name.metric", so exec and size are valid metrics for
+ the test suite you are submitting to.
"""
machine_info = {}
Modified: lnt/trunk/lnt/lnttool/main.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/lnttool/main.py?rev=307710&r1=307709&r2=307710&view=diff
==============================================================================
--- lnt/trunk/lnt/lnttool/main.py (original)
+++ lnt/trunk/lnt/lnttool/main.py Tue Jul 11 13:58:36 2017
@@ -5,11 +5,9 @@ import sys
import json
import contextlib
import code
-import werkzeug.contrib.profiler
import click
import lnt
-import lnt.util.ImportData
from lnt.testing.util.commands import note, warning, error, LOGGER_NAME
import lnt.testing.profile.profile as profile
from lnt.tests.nt import NTTest
@@ -57,6 +55,7 @@ unpacked into a temporary directory and
passing database instances back and forth, when others only need to be able to
view the results.
"""
+ import lnt.server.ui.app
# Setup the base LNT logger.
# Root logger in debug.
@@ -77,11 +76,11 @@ view the results.
sa_logger.setLevel(logging.INFO)
sa_logger.addHandler(handler)
- import lnt.server.ui.app
app = lnt.server.ui.app.App.create_standalone(instance_path,)
if debugger:
app.debug = True
if profiler:
+ import werkzeug.contrib.profiler
if profiler_dir:
if not os.path.isdir(profiler_dir):
os.mkdir(profiler_dir)
@@ -114,6 +113,7 @@ def action_checkformat(input_file, tests
import lnt.server.db.v4db
import lnt.server.config
+ import lnt.util.ImportData
db = lnt.server.db.v4db.V4DB('sqlite:///:memory:',
lnt.server.config.Config.dummy_instance())
result = lnt.util.ImportData.import_and_report(
@@ -171,7 +171,8 @@ def action_showtests():
@click.argument("files", nargs=-1, type=click.Path(exists=True), required=True)
@click.option("--commit", show_default=True, type=int,
help="number of days to show in report")
- at click.option("--verbose", "-v", is_flag=True, help="show verbose test results")
+ at click.option("--verbose", "-v", is_flag=True,
+ help="show verbose test results")
def action_submit(url, files, commit, verbose):
"""submit a test report to the server"""
@@ -180,6 +181,7 @@ def action_submit(url, files, commit, ve
" at the server.")
from lnt.util import ServerUtil
+ import lnt.util.ImportData
files = ServerUtil.submitFiles(url, files, commit, verbose)
for submitted_file in files:
if verbose:
@@ -187,6 +189,7 @@ def action_submit(url, files, commit, ve
submitted_file, sys.stdout, sys.stderr, True)
_print_result_url(submitted_file, verbose)
+
@click.command("update")
@click.argument("db_path")
@click.option("--show-sql", is_flag=True, help="show all SQL queries")
@@ -472,6 +475,7 @@ error: installed distribution %s is not
LNT or rerun 'setup.py develop' if using development mode.""" % (
installed_dist_name, current_dist_name))
+
def show_version(ctx, param, value):
"""print LNT version"""
if not value or ctx.resilient_parsing:
Modified: lnt/trunk/lnt/lnttool/updatedb.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/lnttool/updatedb.py?rev=307710&r1=307709&r2=307710&view=diff
==============================================================================
--- lnt/trunk/lnt/lnttool/updatedb.py (original)
+++ lnt/trunk/lnt/lnttool/updatedb.py Tue Jul 11 13:58:36 2017
@@ -37,8 +37,10 @@ def action_updatedb(instance_path, datab
order = None
# Compute a list of all the runs to delete.
if delete_order:
- order = ts.query(ts.Order).filter(ts.Order.id == delete_order).one()
- runs_to_delete = ts.query(ts.Run.id).filter(ts.Run.order_id == order.id).all()
+ order = ts.query(ts.Order) \
+ .filter(ts.Order.id == delete_order).one()
+ runs_to_delete = ts.query(ts.Run.id) \
+ .filter(ts.Run.order_id == order.id).all()
runs_to_delete = [r[0] for r in runs_to_delete]
else:
runs_to_delete = list(delete_runs)
@@ -46,9 +48,9 @@ def action_updatedb(instance_path, datab
if delete_machines:
runs_to_delete.extend(
id
- for id, in ts.query(ts.Run.id).\
- join(ts.Machine).\
- filter(ts.Machine.name.in_(delete_machines)))
+ for id, in (ts.query(ts.Run.id)
+ .join(ts.Machine)
+ .filter(ts.Machine.name.in_(delete_machines))))
# Delete all samples associated with those runs.
ts.query(ts.Sample).\
@@ -60,8 +62,9 @@ def action_updatedb(instance_path, datab
fcs = ts.query(ts.FieldChange). \
filter(ts.FieldChange.run_id == r).all()
for f in fcs:
- ris = ts.query(ts.RegressionIndicator). \
- filter(ts.RegressionIndicator.field_change_id == f.id).all()
+ ris = ts.query(ts.RegressionIndicator) \
+ .filter(ts.RegressionIndicator.field_change_id == f.id) \
+ .all()
for r in ris:
ts.delete(r)
ts.delete(f)
More information about the llvm-commits
mailing list