Skip to content

Commit

Permalink
Import order fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Sep 30, 2016
1 parent f0e154b commit 6741b49
Show file tree
Hide file tree
Showing 22 changed files with 64 additions and 72 deletions.
22 changes: 10 additions & 12 deletions py/mock.py
Expand Up @@ -39,19 +39,18 @@
"""

# library imports
import grp
import glob
import grp
import logging
import logging.config
from optparse import OptionParser
import os
import os.path
import pwd
import sys
import time
import shlex
import shutil

from optparse import OptionParser
import sys
import time

from six.moves import configparser

Expand All @@ -73,17 +72,16 @@
log = logging.getLogger()

# our imports
import mockbuild.exception
from mockbuild.trace_decorator import traceLog
import mockbuild.backend
import mockbuild.uid

from mockbuild import util
import mockbuild.backend
from mockbuild.backend import Commands
from mockbuild.state import State
from mockbuild.plugin import Plugins
from mockbuild.buildroot import Buildroot
import mockbuild.exception
from mockbuild.exception import BadCmdline
from mockbuild.plugin import Plugins
from mockbuild.state import State
from mockbuild.trace_decorator import traceLog
import mockbuild.uid


def scrub_callback(option, opt, value, parser):
Expand Down
7 changes: 3 additions & 4 deletions py/mockbuild/buildroot.py
Expand Up @@ -13,13 +13,12 @@
import tempfile
import uuid

from . import util
from . import mounts
from .exception import BuildRootLocked, RootError, \
ResultDirNotAccessible, Error
from . import uid
from . import util
from .exception import BuildRootLocked, Error, ResultDirNotAccessible, RootError
from .package_manager import package_manager
from .trace_decorator import getLog, traceLog
from . import uid


class Buildroot(object):
Expand Down
4 changes: 2 additions & 2 deletions py/mockbuild/mounts.py
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
# vim: noai:ts=4:sw=4:expandtab

import grp
import os
import os.path
import grp

from . import util
from . import exception
from . import util
from .trace_decorator import traceLog


Expand Down
4 changes: 2 additions & 2 deletions py/mockbuild/package_manager.py
Expand Up @@ -3,11 +3,11 @@

import glob
import os.path
import shutil
import platform
import shutil
from textwrap import dedent

from six.moves import input
from textwrap import dedent

from . import util
from .exception import BuildError, Error, YumError
Expand Down
4 changes: 1 addition & 3 deletions py/mockbuild/plugins/bind_mount.py
Expand Up @@ -7,12 +7,10 @@
# python library imports

# our imports
from mockbuild.mounts import BindMountPoint
from mockbuild.trace_decorator import traceLog

import mockbuild.util

from mockbuild.mounts import BindMountPoint

requires_api_version = "1.1"


Expand Down
5 changes: 2 additions & 3 deletions py/mockbuild/plugins/ccache.py
Expand Up @@ -7,10 +7,9 @@
# python library imports

# our imports
from mockbuild.trace_decorator import traceLog, getLog
import mockbuild.util

from mockbuild.mounts import BindMountPoint
from mockbuild.trace_decorator import getLog, traceLog
import mockbuild.util

requires_api_version = "1.1"

Expand Down
6 changes: 2 additions & 4 deletions py/mockbuild/plugins/chroot_scan.py
Expand Up @@ -5,15 +5,13 @@
# Copyright (C) 2013 Clark Williams <clark.williams@gmail.com>

# python library imports
import re
import os
import os.path
import re
import subprocess

# our imports

from mockbuild.trace_decorator import traceLog, getLog

from mockbuild.trace_decorator import getLog, traceLog
import mockbuild.util

requires_api_version = "1.1"
Expand Down
2 changes: 1 addition & 1 deletion py/mockbuild/plugins/compress_logs.py
Expand Up @@ -4,8 +4,8 @@

import os.path

from mockbuild.trace_decorator import traceLog, getLog
from mockbuild import util
from mockbuild.trace_decorator import getLog, traceLog

requires_api_version = "1.1"

Expand Down
9 changes: 4 additions & 5 deletions py/mockbuild/plugins/lvm_root.py
@@ -1,15 +1,14 @@
# -*- coding: utf-8 -*-
# vim: noai:ts=4:sw=4:expandtab

import os
import fcntl
import errno
import fcntl
import os
import re
import time

from textwrap import dedent
import time

from mockbuild import util, mounts
from mockbuild import mounts, util
from mockbuild.exception import LvmError, LvmLocked

requires_api_version = "1.1"
Expand Down
5 changes: 2 additions & 3 deletions py/mockbuild/plugins/mount.py
Expand Up @@ -20,10 +20,9 @@
("server.example.com:/exports/data", "/mnt/data", "nfs", "rw,hard,intr,nosuid,nodev,noatime,tcp"))
"""


import mockbuild.util
from mockbuild.trace_decorator import traceLog
from mockbuild.mounts import FileSystemMountPoint
from mockbuild.trace_decorator import traceLog
import mockbuild.util

requires_api_version = "1.1"

Expand Down
6 changes: 3 additions & 3 deletions py/mockbuild/plugins/pm_request.py
Expand Up @@ -4,12 +4,12 @@
# Written by Michael Simacek
# Copyright (C) 2015 Red Hat, Inc.

import os
import sys
import logging
import multiprocessing
import os
import shlex
import socket
import logging
import sys

from six.moves import cStringIO as StringIO

Expand Down
2 changes: 1 addition & 1 deletion py/mockbuild/plugins/root_cache.py
Expand Up @@ -10,7 +10,7 @@
import time

# our imports
from mockbuild.trace_decorator import traceLog, getLog
from mockbuild.trace_decorator import getLog, traceLog
import mockbuild.util

requires_api_version = "1.1"
Expand Down
8 changes: 4 additions & 4 deletions py/mockbuild/plugins/selinux.py
Expand Up @@ -5,16 +5,16 @@
# Copyright (C) 2010 Jan Vcelak <jvcelak@redhat.com>

# python library imports
import atexit
import os
import stat
import sys
import tempfile
import stat
import atexit

# our imports
from mockbuild.trace_decorator import traceLog, getLog
import mockbuild.util
from mockbuild.mounts import BindMountPoint
from mockbuild.trace_decorator import getLog, traceLog
import mockbuild.util

requires_api_version = "1.1"

Expand Down
3 changes: 2 additions & 1 deletion py/mockbuild/plugins/sign.py
Expand Up @@ -5,11 +5,12 @@
# Copyright (C) 2014 Facebook

# python library imports
from mockbuild.trace_decorator import traceLog, getLog
import glob
import os
import subprocess

from mockbuild.trace_decorator import getLog, traceLog

requires_api_version = "1.1"


Expand Down
2 changes: 1 addition & 1 deletion py/mockbuild/plugins/tmpfs.py
Expand Up @@ -8,7 +8,7 @@
import os

# our imports
from mockbuild.trace_decorator import traceLog, getLog
from mockbuild.trace_decorator import getLog, traceLog
import mockbuild.util

requires_api_version = "1.1"
Expand Down
8 changes: 4 additions & 4 deletions py/mockbuild/plugins/yum_cache.py
Expand Up @@ -6,14 +6,14 @@

# python library imports
import fcntl
import time
import os
import glob
import os
import time

# our imports
from mockbuild.trace_decorator import traceLog, getLog
import mockbuild.util
from mockbuild.mounts import BindMountPoint
from mockbuild.trace_decorator import getLog, traceLog
import mockbuild.util

# set up logging, module options
requires_api_version = "1.1"
Expand Down
5 changes: 3 additions & 2 deletions py/mockbuild/scm.py
Expand Up @@ -7,13 +7,14 @@
import os
import shlex
import shutil
import six
import subprocess
import sys
import tempfile

from .trace_decorator import traceLog
import six

from . import util
from .trace_decorator import traceLog


class scmWorker(object):
Expand Down
2 changes: 1 addition & 1 deletion py/mockbuild/state.py
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
# vim: noai:ts=4:sw=4:expandtab

from .trace_decorator import getLog
from .exception import StateError
from .trace_decorator import getLog


class State(object):
Expand Down
4 changes: 2 additions & 2 deletions py/mockbuild/trace_decorator.py
Expand Up @@ -4,12 +4,12 @@
# Written by Michael Brown
# Copyright (C) 2007 Michael E Brown <mebrown@michaels-house.net>

import functools
import inspect
import logging
import os
import sys
import types
import inspect
import functools

try:
basestring
Expand Down
24 changes: 12 additions & 12 deletions py/mockbuild/util.py
Expand Up @@ -7,33 +7,33 @@
# Copyright (C) 2007 Michael E Brown <mebrown@michaels-house.net>
from __future__ import print_function

from ast import literal_eval
import ctypes
import errno
import fcntl
from glob import glob
import grp
import locale
import logging
import os
import os.path
import pickle
import pwd
import re
import select
import signal
import stat
import struct
import subprocess
import sys
import stat
import time
import errno
import grp
import locale
import logging
import uuid
import termios
import struct
from glob import glob
from ast import literal_eval
from textwrap import dedent
import time
import uuid

from . import exception
from .trace_decorator import traceLog, getLog
from .uid import setresuid, getresuid
from .trace_decorator import getLog, traceLog
from .uid import getresuid, setresuid

encoding = locale.getpreferredencoding()

Expand Down
2 changes: 1 addition & 1 deletion py/mockchain.py
Expand Up @@ -30,13 +30,13 @@
import optparse
import os
import re
import requests
import shutil
import subprocess
import sys
import tempfile
import time

import requests
from six.moves.urllib_parse import urlsplit

import mockbuild.util
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-cfgs.py
Expand Up @@ -3,9 +3,9 @@
# Script to check validity of mock config URLs
#

import glob
import os
import os.path
import glob

from six.moves import urllib

Expand Down

0 comments on commit 6741b49

Please sign in to comment.