Browse Source

PEP8 failed when import i18n more than one

1. What is the problem
  When "from tricircle.common.i18n import _, _LE, _LI, _LW"
  The pep8 failed: ./tricircle/network/central_plugin.py:50:36:
  H301 one import per line

2. What is the solution to the problem
  i18n import in one line is a valid exception, and could be skipped
  in pep8 test

3. What the features need to be implemented to the Tricircle
  N/A

Closes-Bug: #1646372
Change-Id: I2adeab4d098ff4bbe8abb1d6645a20086ee5a1b7
changes/18/405718/6
zhangyanxian 5 years ago
parent
commit
491fa1693f
6 changed files with 8 additions and 15 deletions
  1. +1
    -2
      cmd/xjob.py
  2. +3
    -0
      tox.ini
  3. +1
    -4
      tricircle/network/central_plugin.py
  4. +1
    -2
      tricircle/network/drivers/type_shared_vlan.py
  5. +1
    -4
      tricircle/xjob/xmanager.py
  6. +1
    -3
      tricircle/xjob/xservice.py

+ 1
- 2
cmd/xjob.py View File

@ -28,8 +28,7 @@ from oslo_config import cfg
from oslo_log import log as logging
from tricircle.common import config
from tricircle.common.i18n import _LI
from tricircle.common.i18n import _LW
from tricircle.common.i18n import _LI, _LW
from tricircle.xjob import xservice


+ 3
- 0
tox.ini View File

@ -46,3 +46,6 @@ commands = oslo_debug_helper {posargs}
show-source = True
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
[hacking]
import_exceptions = tricircle.common.i18n

+ 1
- 4
tricircle/network/central_plugin.py View File

@ -47,10 +47,7 @@ import tricircle.common.client as t_client
import tricircle.common.constants as t_constants
import tricircle.common.context as t_context
import tricircle.common.exceptions as t_exceptions
from tricircle.common.i18n import _
from tricircle.common.i18n import _LE
from tricircle.common.i18n import _LI
from tricircle.common.i18n import _LW
from tricircle.common.i18n import _, _LE, _LI, _LW
from tricircle.common import xrpcapi
import tricircle.db.api as db_api
from tricircle.db import core


+ 1
- 2
tricircle/network/drivers/type_shared_vlan.py View File

@ -23,8 +23,7 @@ from neutron.plugins.ml2 import driver_api
from neutron.plugins.ml2.drivers import type_vlan
from tricircle.common import constants
from tricircle.common.i18n import _LE
from tricircle.common.i18n import _LI
from tricircle.common.i18n import _LE, _LI
LOG = log.getLogger(__name__)


+ 1
- 4
tricircle/xjob/xmanager.py View File

@ -29,10 +29,7 @@ import neutronclient.common.exceptions as q_cli_exceptions
from tricircle.common import client
from tricircle.common import constants
from tricircle.common.i18n import _
from tricircle.common.i18n import _LE
from tricircle.common.i18n import _LI
from tricircle.common.i18n import _LW
from tricircle.common.i18n import _, _LE, _LI, _LW
from tricircle.common import xrpcapi
import tricircle.db.api as db_api
from tricircle.db import core


+ 1
- 3
tricircle/xjob/xservice.py View File

@ -24,9 +24,7 @@ from oslo_log import log as logging
import oslo_messaging as messaging
from oslo_service import service as srv
from tricircle.common.i18n import _
from tricircle.common.i18n import _LE
from tricircle.common.i18n import _LI
from tricircle.common.i18n import _, _LE, _LI
from tricircle.common import baserpc
from tricircle.common import context


Loading…
Cancel
Save