From a46f36eee2da0c882fec110034dee10d94519116 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Wed, 27 Feb 2019 22:54:58 +0800 Subject: configs/manager: Add update() method --- fg21sim/configs/manager.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fg21sim') diff --git a/fg21sim/configs/manager.py b/fg21sim/configs/manager.py index 9e0ddbe..76ece70 100644 --- a/fg21sim/configs/manager.py +++ b/fg21sim/configs/manager.py @@ -408,6 +408,10 @@ class ConfigManager: logger.info("Set config: {key}: {val_old} -> {val_new}".format( key="/".join(key), val_new=val_new, val_old=val_old)) + def update(self, **kwargs): + for key, value in kwargs.items(): + self.setn(key, value) + def __setitem__(self, key, value): self.setn(key, value) -- cgit v1.2.2