Allow fw env tools to be available as library
[oweals/u-boot.git] / tools / buildman / bsettings.py
index fdd875b0736f9ec918c443b50778c84aef33cdfa..b36146918005b92ce6eafd5af88ba664b0200bfa 100644 (file)
@@ -40,7 +40,16 @@ def GetItems(section):
     try:
         return settings.items(section)
     except ConfigParser.NoSectionError as e:
-        print e
         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)