Allow fw env tools to be available as library
[oweals/u-boot.git] / tools / buildman / bsettings.py
index 9eb9b2bd53aad8e2b19921f62e4c232363788262..b36146918005b92ce6eafd5af88ba664b0200bfa 100644 (file)
@@ -43,3 +43,13 @@ def GetItems(section):
         return []
     except:
         raise
+
+def SetItem(section, tag, value):
+    """Set an item and write it back to the settings file"""
+    global settings
+    global config_fname
+
+    settings.set(section, tag, value)
+    if config_fname is not None:
+        with open(config_fname, 'w') as fd:
+            settings.write(fd)