提交 014d11c7 编写于 作者: C Cleber Rosa

API review: use relative imports in avocado.utils modules

It was mentioned that we should think of avocado.utils as a subproject
that happens to live in the same source tree. So, it should not make
use of any avocado module. If that's the case, maybe we don't want to
keep referencing 'avocado.utils' in the utils module themselves.

This is in accordance with PEP-0328[1]

[1] - https://www.python.org/dev/peps/pep-0328/Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 f8f898a7
......@@ -14,7 +14,7 @@
import os
import process
from . import process
def make(path, make='make', env=None, extra_args='', ignore_status=False, allow_output_check='none'):
......
......@@ -23,7 +23,7 @@ import socket
import shutil
import urllib2
from avocado.utils import aurl
from . import aurl
log = logging.getLogger('avocado.test')
......
......@@ -30,8 +30,8 @@ try:
except ImportError:
import subprocess
from avocado.utils import network
from avocado.utils.external import gdbmi_parser
from . import network
from .external import gdbmi_parser
GDB_PROMPT = '(gdb)'
GDB_EXIT = '^exit'
......
......@@ -20,7 +20,7 @@ import logging
import os
import time
from avocado.utils import path as utils_path
from . import path as utils_path
log = logging.getLogger('avocado.test')
......
......@@ -18,7 +18,7 @@ import os
import logging
import shutil
from avocado.utils import download, archive, build
from . import download, archive, build
log = logging.getLogger('avocado.test')
......
......@@ -22,7 +22,7 @@ import glob
import math
import logging
from avocado.utils import process
from . import process
# Returns total memory in kb
......
......@@ -19,7 +19,7 @@ Avocado path related functions.
import os
import stat
from avocado.utils import aurl
from . import aurl
PY_EXTENSIONS = ['.py']
......
......@@ -34,8 +34,9 @@ except ImportError:
import subprocess
SUBPROCESS32_SUPPORT = False
from . import gdb
from avocado import runtime
from avocado.utils import gdb
from avocado.core import exceptions
log = logging.getLogger('avocado.test')
......
......@@ -21,7 +21,7 @@ import logging
import time
from avocado.core import output
from avocado.utils import process
from . import process
LOG = logging.getLogger('avocado.test')
......
......@@ -20,7 +20,7 @@ import os
import tempfile
import shutil
from avocado.utils import path as utils_path
from . import path as utils_path
class Script(object):
......
......@@ -49,10 +49,10 @@ except ImportError:
else:
HAS_YUM_MODULE = True
from avocado.utils import process
from avocado.utils import data_factory
from avocado.utils import distro
from avocado.utils import path as utils_path
from . import process
from . import data_factory
from . import distro
from . import path as utils_path
log = logging.getLogger('avocado.test')
......
......@@ -19,7 +19,7 @@ Module to provide classes for Virtual Machines.
import logging
from xml.dom import minidom
from avocado.utils import remote
from . import remote
LOG = logging.getLogger('avocado.test')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册