summaryrefslogtreecommitdiff
path: root/tools/binman/entry.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/binman/entry.py')
-rw-r--r--tools/binman/entry.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index 1244d36c20..9f62322bed 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -9,9 +9,9 @@ import importlib
import os
import sys
-import fdt_util
+from dtoc import fdt_util
import tools
-from tools import ToHex, ToHexSize
+from patman.tools import ToHex, ToHexSize
import tout
modules = {}
@@ -63,7 +63,7 @@ class Entry(object):
def __init__(self, section, etype, node, name_prefix=''):
# Put this here to allow entry-docs and help to work without libfdt
global state
- import state
+ from binman import state
self.section = section
self.etype = etype
@@ -108,15 +108,11 @@ class Entry(object):
# Import the module if we have not already done so.
if not module:
- old_path = sys.path
- sys.path.insert(0, os.path.join(our_path, 'etype'))
try:
- module = importlib.import_module(module_name)
+ module = importlib.import_module('binman.etype.' + module_name)
except ImportError as e:
raise ValueError("Unknown entry type '%s' in node '%s' (expected etype/%s.py, error '%s'" %
(etype, node_path, module_name, e))
- finally:
- sys.path = old_path
modules[module_name] = module
# Look up the expected class name
@@ -590,9 +586,7 @@ features to produce new behaviours.
modules.remove('_testing')
missing = []
for name in modules:
- if name.startswith('__'):
- continue
- module = Entry.Lookup(name, name)
+ module = Entry.Lookup('WriteDocs', name)
docs = getattr(module, '__doc__')
if test_missing == name:
docs = None