From f8f898a700d46eb6d48cd3052a7a61ebfa81fce9 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Mon, 8 Jun 2015 14:36:07 -0300 Subject: [PATCH] API review: move avocado.gdb to avocado.utils.gdb This means also moving its dependencies, namely spark and gdbmi_parser, to a place under avocado/utils. I've chosen to add another level here to clearly identify those deps as 3rd party external modules that are reused in Avocado. Signed-off-by: Cleber Rosa --- avocado/utils/external/__init__.py | 13 +++++++++++++ avocado/{core => utils/external}/gdbmi_parser.py | 0 avocado/{core => utils/external}/spark.py | 0 avocado/{ => utils}/gdb.py | 2 +- avocado/utils/process.py | 2 +- examples/tests/gdbtest.py | 2 +- examples/tests/modify_variable.py | 2 +- selftests/all/unit/avocado/gdb_unittest.py | 2 +- 8 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 avocado/utils/external/__init__.py rename avocado/{core => utils/external}/gdbmi_parser.py (100%) rename avocado/{core => utils/external}/spark.py (100%) rename avocado/{ => utils}/gdb.py (99%) diff --git a/avocado/utils/external/__init__.py b/avocado/utils/external/__init__.py new file mode 100644 index 00000000..2e6001fa --- /dev/null +++ b/avocado/utils/external/__init__.py @@ -0,0 +1,13 @@ +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# See LICENSE for more details. +# +# Copyright: Red Hat Inc. 2015 +# Author: Cleber Rosa diff --git a/avocado/core/gdbmi_parser.py b/avocado/utils/external/gdbmi_parser.py similarity index 100% rename from avocado/core/gdbmi_parser.py rename to avocado/utils/external/gdbmi_parser.py diff --git a/avocado/core/spark.py b/avocado/utils/external/spark.py similarity index 100% rename from avocado/core/spark.py rename to avocado/utils/external/spark.py diff --git a/avocado/gdb.py b/avocado/utils/gdb.py similarity index 99% rename from avocado/gdb.py rename to avocado/utils/gdb.py index 54cbc5a0..65501847 100644 --- a/avocado/gdb.py +++ b/avocado/utils/gdb.py @@ -31,7 +31,7 @@ except ImportError: import subprocess from avocado.utils import network -from avocado.core import gdbmi_parser +from avocado.utils.external import gdbmi_parser GDB_PROMPT = '(gdb)' GDB_EXIT = '^exit' diff --git a/avocado/utils/process.py b/avocado/utils/process.py index 0cc38b45..a3a15b16 100644 --- a/avocado/utils/process.py +++ b/avocado/utils/process.py @@ -34,8 +34,8 @@ except ImportError: import subprocess SUBPROCESS32_SUPPORT = False -from avocado import gdb from avocado import runtime +from avocado.utils import gdb from avocado.core import exceptions log = logging.getLogger('avocado.test') diff --git a/examples/tests/gdbtest.py b/examples/tests/gdbtest.py index 671188f6..abcbb6db 100755 --- a/examples/tests/gdbtest.py +++ b/examples/tests/gdbtest.py @@ -3,8 +3,8 @@ import os from avocado import Test -from avocado import gdb from avocado import main +from avocado.utils import gdb from avocado.utils import process diff --git a/examples/tests/modify_variable.py b/examples/tests/modify_variable.py index 1f55643e..d4bf83e1 100755 --- a/examples/tests/modify_variable.py +++ b/examples/tests/modify_variable.py @@ -3,9 +3,9 @@ import os import shutil -from avocado import gdb from avocado import main from avocado import Test +from avocado.utils import gdb from avocado.utils import build diff --git a/selftests/all/unit/avocado/gdb_unittest.py b/selftests/all/unit/avocado/gdb_unittest.py index f62422a9..892c958b 100644 --- a/selftests/all/unit/avocado/gdb_unittest.py +++ b/selftests/all/unit/avocado/gdb_unittest.py @@ -9,7 +9,7 @@ if os.path.isdir(os.path.join(basedir, 'avocado')): sys.path.append(basedir) -from avocado import gdb +from avocado.utils import gdb class GDBRemoteTest(unittest.TestCase): -- GitLab