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