binman: Move state information into a new module

At present the control module has state information in it, since it is the
primary user of this. But it is a bit odd to have entries and other
modules importing control to obtain this information.

It seems better to have a dedicated state module, which control can use as
well. Create a new module using code from control and update other modules
to use it.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2018-09-14 04:57:19 -06:00
parent 6c234bfbf7
commit c55a50f558
5 changed files with 95 additions and 48 deletions

View file

@ -17,10 +17,11 @@ try:
except:
have_importlib = False
import fdt_util
import control
import os
import sys
import fdt_util
import state
import tools
modules = {}
@ -393,7 +394,7 @@ class Entry(object):
Raises:
ValueError if the argument cannot be converted to in
"""
value = control.GetEntryArg(name)
value = state.GetEntryArg(name)
if value is not None:
if datatype == int:
try: