summaryrefslogtreecommitdiff
path: root/tools/binman/control.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-08-05 13:27:46 -0600
committerSimon Glass <sjg@chromium.org>2020-08-22 08:53:38 -0600
commit87d43329ef7698eab5b090a91228269c39643122 (patch)
tree9440be9be37be55fee8329b841253dbf0317685e /tools/binman/control.py
parent702e57e113d85fef60ebe9e5c87194414666cfac (diff)
binman: Move GetEntryModules() to control
When binman is installed its main program is in a different directory to its modules. This means that __file__ is different and we cannot use it to obtain the path to etype/ from main.py To fix this, move the function to the 'control' module, since it is installed with all the other modules, including the etype/ directory. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/control.py')
-rw-r--r--tools/binman/control.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/binman/control.py b/tools/binman/control.py
index 343b0a0c35..69c36ed658 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -6,6 +6,7 @@
#
from collections import OrderedDict
+import glob
import os
import sys
from patman import tools
@@ -51,6 +52,18 @@ def _FindBinmanNode(dtb):
return node
return None
+def GetEntryModules(include_testing=True):
+ """Get a set of entry class implementations
+
+ Returns:
+ Set of paths to entry class filenames
+ """
+ our_path = os.path.dirname(os.path.realpath(__file__))
+ glob_list = glob.glob(os.path.join(our_path, 'etype/*.py'))
+ return set([os.path.splitext(os.path.basename(item))[0]
+ for item in glob_list
+ if include_testing or '_testing' not in item])
+
def WriteEntryDocs(modules, test_missing=None):
"""Write out documentation for all entries