Skip to content

Commit

Permalink
Adapt to flake8-import-order
Browse files Browse the repository at this point in the history
https://review.openstack.org/#/c/432906/
flake8-import-order adds 3 new flake8 warnings:
I100: Your import statements are in the wrong order.
I101: The names in your from import are in the wrong order.
I201: Missing newline between sections or imports.

Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
xurong00037997 authored and blp committed Mar 9, 2017
1 parent 5575908 commit 6c7050b
Show file tree
Hide file tree
Showing 29 changed files with 103 additions and 77 deletions.
13 changes: 6 additions & 7 deletions python/ovs/db/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@
import re
import uuid

import six

import ovs.poller
import ovs.socket_util
import ovs.db.parser
import ovs.db.types
import ovs.json
import ovs.jsonrpc
import ovs.ovsuuid

import ovs.db.parser
import ovs.poller
import ovs.socket_util
from ovs.db import error
import ovs.db.types

import six


class ConstraintViolation(error.Error):
Expand Down
8 changes: 4 additions & 4 deletions python/ovs/db/idl.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
import functools
import uuid

import six

import ovs.jsonrpc
import ovs.db.data as data
import ovs.db.parser
import ovs.db.schema
from ovs.db import error
import ovs.jsonrpc
import ovs.ovsuuid
import ovs.poller
import ovs.vlog
from ovs.db import error

import six

vlog = ovs.vlog.Vlog("idl")

Expand Down
4 changes: 2 additions & 2 deletions python/ovs/db/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

import re

import six

from ovs.db import error

import six


class Parser(object):
def __init__(self, json, name):
Expand Down
6 changes: 3 additions & 3 deletions python/ovs/db/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
import re
import sys

import six

from ovs.db import error
import ovs.db.parser
import ovs.db.types
from ovs.db import error

import six


def _check_id(name, json):
Expand Down
8 changes: 4 additions & 4 deletions python/ovs/db/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
import sys
import uuid

import six

from ovs.db import error
import ovs.db.parser
import ovs.db.data
import ovs.db.parser
import ovs.ovsuuid
from ovs.db import error

import six


class AtomicType(object):
Expand Down
8 changes: 6 additions & 2 deletions python/ovs/fcntl_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@
# limitations under the License.

import errno

import msvcrt

import pywintypes

import win32con

import win32file
import pywintypes
import msvcrt

LOCK_EX = win32con.LOCKFILE_EXCLUSIVE_LOCK
LOCK_SH = 0 # the default
Expand Down
1 change: 1 addition & 0 deletions python/ovs/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from __future__ import absolute_import

import functools
import json
import re
Expand Down
4 changes: 2 additions & 2 deletions python/ovs/jsonrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import os
import sys

import six

import ovs.json
import ovs.poller
import ovs.reconnect
Expand All @@ -26,6 +24,8 @@
import ovs.util
import ovs.vlog

import six

EOF = ovs.util.EOF
vlog = ovs.vlog.Vlog("jsonrpc")

Expand Down
6 changes: 3 additions & 3 deletions python/ovs/ovsuuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
import re
import uuid

import ovs.db.parser
from ovs.db import error

import six
from six.moves import range

from ovs.db import error
import ovs.db.parser

uuidRE = re.compile("^xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx$"
.replace('x', '[0-9a-fA-F]'))

Expand Down
8 changes: 5 additions & 3 deletions python/ovs/poller.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
# limitations under the License.

import errno
import ovs.timeval
import ovs.vlog
import os

import select
import socket
import os
import sys

import ovs.timeval
import ovs.vlog

if sys.platform == "win32":
import ovs.winutils as winutils

Expand Down
2 changes: 1 addition & 1 deletion python/ovs/reconnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import os

import ovs.vlog
import ovs.util
import ovs.vlog

# Values returned by Reconnect.run()
CONNECT = 'connect'
Expand Down
6 changes: 3 additions & 3 deletions python/ovs/socket_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
import socket
import sys

import six
from six.moves import range

import ovs.fatal_signal
import ovs.poller
import ovs.vlog

import six
from six.moves import range

if sys.platform == 'win32':
import ovs.winutils as winutils
import win32file
Expand Down
4 changes: 2 additions & 2 deletions python/ovs/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
import socket
import sys

import six

import ovs.poller
import ovs.socket_util
import ovs.vlog

import six

try:
from OpenSSL import SSL
except ImportError:
Expand Down
3 changes: 2 additions & 1 deletion python/ovs/unixctl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import six
import sys

import ovs.util

import six

commands = {}
strtypes = six.string_types

Expand Down
3 changes: 1 addition & 2 deletions python/ovs/unixctl/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@

import os

import six

import ovs.jsonrpc
import ovs.stream
import ovs.util

import six

vlog = ovs.vlog.Vlog("unixctl_client")
strtypes = six.string_types
Expand Down
6 changes: 3 additions & 3 deletions python/ovs/unixctl/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
import os
import sys

import six
from six.moves import range

import ovs.dirs
import ovs.jsonrpc
import ovs.stream
Expand All @@ -28,6 +25,9 @@
import ovs.version
import ovs.vlog

import six
from six.moves import range

Message = ovs.jsonrpc.Message
vlog = ovs.vlog.Vlog("unixctl_server")
strtypes = six.string_types
Expand Down
6 changes: 3 additions & 3 deletions python/ovs/vlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
import sys
import threading

import six
from six.moves import range

import ovs.dirs
import ovs.unixctl
import ovs.util

import six
from six.moves import range

DESTINATIONS = {"console": "info", "file": "info", "syslog": "info"}
PATTERNS = {
"console": "%D{%Y-%m-%dT%H:%M:%SZ}|%05N|%c%T|%p|%m",
Expand Down
11 changes: 6 additions & 5 deletions python/ovs/winutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import six
import sys

import six

if sys.platform != 'win32':
raise Exception("Intended to use only on Windows")
else:
import pywintypes
import winerror
import win32pipe
import win32con
import win32security
import win32file
import win32event
import win32file
import win32pipe
import win32security
import winerror


def close_handle(handle, logger=None):
Expand Down
11 changes: 8 additions & 3 deletions python/ovstest/rpcserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,23 @@

from __future__ import print_function

import exceptions
import sys

import exceptions

import six.moves.xmlrpc_client

import tcp

from twisted.internet import reactor
from twisted.internet.error import CannotListenError
from twisted.web import xmlrpc
from twisted.web import server
from twisted.web import xmlrpc

import tcp
import udp

import util

import vswitch


Expand Down
6 changes: 4 additions & 2 deletions python/ovstest/tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
tcp module contains listener and sender classes for TCP protocol
"""

from twisted.internet.protocol import Factory, ClientFactory, Protocol
import time

from twisted.internet import interfaces
from twisted.internet.protocol import ClientFactory, Factory, Protocol

from zope.interface import implements
import time


class TcpListenerConnection(Protocol):
Expand Down
10 changes: 6 additions & 4 deletions python/ovstest/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,20 @@
util module contains some helper function
"""
import array
import exceptions
import fcntl

import os
import re
import select
import signal
import socket
import struct
import signal
import subprocess
import re

from six.moves import range
import exceptions

import six.moves.xmlrpc_client
from six.moves import range


def str_ip(ip_address):
Expand Down
1 change: 1 addition & 0 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# limitations under the License.

from __future__ import print_function

import sys

from distutils.command.build_ext import build_ext
Expand Down
1 change: 1 addition & 0 deletions tests/test-json.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import sys

import ovs.json

import six


Expand Down
Loading

0 comments on commit 6c7050b

Please sign in to comment.