Fix pep8 errors

This commit is contained in:
Masayuki Igawa 2016-11-04 16:30:12 +09:00
parent d0bc83a49c
commit f496c95108
7 changed files with 35 additions and 19 deletions

View File

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

View File

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

View File

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

View File

@ -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 """Add coverages table
Revision ID: 52dfb338f74e Revision ID: 52dfb338f74e

View File

@ -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 """Add test_type column
Revision ID: cb0e61ce633e Revision ID: cb0e61ce633e

View File

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

View File

@ -19,10 +19,8 @@ import sys
from oslo_config import cfg from oslo_config import cfg
from oslo_db import options from oslo_db import options
from pbr import version from pbr import version
from stevedore import enabled
from coverage2sql.db import api from coverage2sql.db import api
# from coverage2sql import exceptions
from coverage2sql import read_coverage as coverage from coverage2sql import read_coverage as coverage
CONF = cfg.CONF CONF = cfg.CONF
@ -30,9 +28,9 @@ CONF.import_opt('verbose', 'coverage2sql.db.api')
SHELL_OPTS = [ SHELL_OPTS = [
cfg.StrOpt('project_name', positional=True, required=True, 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, 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'), cfg.StrOpt('connection'),
] ]
@ -75,7 +73,7 @@ def main():
coverage_rate = cov.get_coverage_rate() coverage_rate = cov.get_coverage_rate()
else: else:
raise NotImplementedError() raise NotImplementedError()
#cov = coverage.ReadCoverage(sys.stdin) # cov = coverage.ReadCoverage(sys.stdin)
process_results(project_name, coverage_rate) process_results(project_name, coverage_rate)