Fix pep8 errors

changes/06/396006/1
Masayuki Igawa 6 years ago
parent d0bc83a49c
commit f496c95108
  1. 5
      coverage2sql/db/api.py
  2. 3
      coverage2sql/db/models.py
  3. 4
      coverage2sql/migrations/cli.py
  4. 15
      coverage2sql/migrations/versions/52dfb338f74e_add_coverages_table.py
  5. 15
      coverage2sql/migrations/versions/cb0e61ce633e_add_test_type_column.py
  6. 4
      coverage2sql/read_coverage.py
  7. 8
      coverage2sql/shell.py

@ -12,19 +12,14 @@
# License for the specific language governing permissions and limitations
# under the License.
import collections
import datetime
from oslo_config import cfg
from oslo_db.sqlalchemy import session as db_session
import six
import sqlalchemy
from sqlalchemy.engine.url import make_url
import logging
from coverage2sql.db import models
#from coverage2sql import exceptions
CONF = cfg.CONF
CONF.register_cli_opt(cfg.BoolOpt('verbose', short='v', default=False,

@ -13,10 +13,7 @@
# under the License.
import datetime
import uuid
#from oslo_db.sqlalchemy import models # noqa
import six
import sqlalchemy as sa
from sqlalchemy.ext import declarative

@ -21,7 +21,6 @@ from alembic import config as alembic_config
from alembic import script as alembic_script
from alembic import util as alembic_util
from oslo_config import cfg
#from oslo_db import options
from coverage2sql.db import api as db_api
@ -44,7 +43,6 @@ MIGRATION_OPTS = [
]
CONF = cfg.CONF
#CONF.register_cli_opts(options.database_opts, group='database')
CONF.register_cli_opts(MIGRATION_OPTS)
CONF.import_opt('verbose', 'coverage2sql.db.api')
@ -97,7 +95,7 @@ def validate_head_file(config):
head_path = os.path.join(script.versions, HEAD_FILENAME)
if (os.path.isfile(head_path) and
open(head_path).read().strip() == script.get_current_head()):
open(head_path).read().strip() == script.get_current_head()):
return
else:
alembic_util.err('HEAD file does not match migration timeline head')

@ -1,3 +1,18 @@
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Add coverages table
Revision ID: 52dfb338f74e

@ -1,3 +1,18 @@
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Add test_type column
Revision ID: cb0e61ce633e

@ -16,9 +16,7 @@ import coverage
class DevNull(object):
"""
A file like '/dev/null'
"""
"""A file like '/dev/null' """
def write(self, *args, **kwargs):
pass

@ -19,10 +19,8 @@ import sys
from oslo_config import cfg
from oslo_db import options
from pbr import version
from stevedore import enabled
from coverage2sql.db import api
# from coverage2sql import exceptions
from coverage2sql import read_coverage as coverage
CONF = cfg.CONF
@ -30,9 +28,9 @@ CONF.import_opt('verbose', 'coverage2sql.db.api')
SHELL_OPTS = [
cfg.StrOpt('project_name', positional=True, required=True,
help='project name of the coverage files'),
help='project name of the coverage files'),
cfg.StrOpt('coverage_file', positional=True,
help='A coverage file to put into the database'),
help='A coverage file to put into the database'),
cfg.StrOpt('connection'),
]
@ -75,7 +73,7 @@ def main():
coverage_rate = cov.get_coverage_rate()
else:
raise NotImplementedError()
#cov = coverage.ReadCoverage(sys.stdin)
# cov = coverage.ReadCoverage(sys.stdin)
process_results(project_name, coverage_rate)

Loading…
Cancel
Save