Commit e430440232e455c0b670a3f5647fbab649e34f4b

Authored by Simon Glass
1 parent c073ced7a3

binman: Allow easy importing of entry modules

At present entry modules can only be accessed using Entry.Lookup() or
Entry.Create(). Most of the time this is fine, but sometimes a module
needs to provide constants or helper functions useful to other modules.
It is easier in this case to use 'import'.

Add an __init__ file to permit this.

Signed-off-by: Simon Glass <sjg@chromium.org>

Showing 2 changed files with 3 additions and 0 deletions Side-by-side Diff

tools/binman/entry.py
... ... @@ -513,6 +513,8 @@
513 513 modules.remove('_testing')
514 514 missing = []
515 515 for name in modules:
  516 + if name.startswith('__'):
  517 + continue
516 518 module = Entry.Lookup(name, name)
517 519 docs = getattr(module, '__doc__')
518 520 if test_missing == name:
tools/patman/test_util.py
... ... @@ -58,6 +58,7 @@
58 58 test_set = set([os.path.splitext(os.path.basename(line.split()[0]))[0]
59 59 for line in lines if '/etype/' in line])
60 60 missing_list = required
  61 + missing_list.discard('__init__')
61 62 missing_list.difference_update(test_set)
62 63 if missing_list:
63 64 print('Missing tests for %s' % (', '.join(missing_list)))