patman: Move to absolute imports
At present patman sets the python path on startup so that it can access
the libraries it needs. If we convert to use absolute imports this is not
necessary.
Move patman to use absolute imports. This requires changes in tools which
use the patman libraries (which is most of them).
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index b7f2c42..f8e71de 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -19,10 +19,10 @@
from buildman import builderthread
from buildman import toolchain
-import command
-import gitutil
-import terminal
-from terminal import Print
+from patman import command
+from patman import gitutil
+from patman import terminal
+from patman.terminal import Print
"""
Theory of Operation
diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py
index f673f38..48fcd6c 100644
--- a/tools/buildman/builderthread.py
+++ b/tools/buildman/builderthread.py
@@ -9,8 +9,8 @@
import sys
import threading
-import command
-import gitutil
+from patman import command
+from patman import gitutil
RETURN_CODE_RETRY = -1
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index e05234c..071c261 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -12,11 +12,11 @@
from buildman import bsettings
from buildman import toolchain
from buildman.builder import Builder
-import command
-import gitutil
-import patchstream
-import terminal
-from terminal import Print
+from patman import command
+from patman import gitutil
+from patman import patchstream
+from patman import terminal
+from patman.terminal import Print
def GetPlural(count):
"""Returns a plural 's' if count is not 1"""
diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py
index 9bfdd53..418677f 100644
--- a/tools/buildman/func_test.py
+++ b/tools/buildman/func_test.py
@@ -13,11 +13,10 @@
from buildman import cmdline
from buildman import control
from buildman import toolchain
-import command
-import gitutil
-import terminal
-import toolchain
-import tools
+from patman import command
+from patman import gitutil
+from patman import terminal
+from patman import tools
settings_data = '''
# Buildman settings file
diff --git a/tools/buildman/main.py b/tools/buildman/main.py
index 94d495c4..52a83fc 100755
--- a/tools/buildman/main.py
+++ b/tools/buildman/main.py
@@ -25,9 +25,9 @@
from buildman import cmdline
from buildman import control
from buildman import toolchain
-import patchstream
-import gitutil
-import terminal
+from patman import patchstream
+from patman import gitutil
+from patman import terminal
def RunTests(skip_net_tests):
import func_test
diff --git a/tools/buildman/test.py b/tools/buildman/test.py
index 87175ee..b37c37b2 100644
--- a/tools/buildman/test.py
+++ b/tools/buildman/test.py
@@ -18,11 +18,11 @@
from buildman import builder
from buildman import control
from buildman import toolchain
-import commit
-import command
-import terminal
-import test_util
-import tools
+from patman import commit
+from patman import command
+from patman import terminal
+from patman import test_util
+from patman import tools
use_network = True
diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py
index a354049..acb5a29 100644
--- a/tools/buildman/toolchain.py
+++ b/tools/buildman/toolchain.py
@@ -11,9 +11,9 @@
import urllib.request, urllib.error, urllib.parse
from buildman import bsettings
-import command
-import terminal
-import tools
+from patman import command
+from patman import terminal
+from patman import tools
(PRIORITY_FULL_PREFIX, PRIORITY_PREFIX_GCC, PRIORITY_PREFIX_GCC_PATH,
PRIORITY_CALC) = list(range(4))