commit 7a13d255242770503b0d84eb17de5b0ea563b191
parent f5ab76e81ab95fd80e04b1a278b127f1cc791b5e
Author: lash <dev@holbrook.no>
Date: Thu, 12 May 2022 18:21:18 +0000
Add common value processing with aiee
Diffstat:
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git a/chainlib/settings.py b/chainlib/settings.py
@@ -1,3 +1,6 @@
+# external imports
+from aiee.numbers import postfix_to_int
+
# local imports
from .chain import ChainSpec
@@ -28,6 +31,19 @@ def process_settings_common(settings, config):
return settings
+def process_settings_value(settings, config):
+ value = None
+ try:
+ value = config.get('_VALUE')
+ except KeyError:
+ return settings
+
+ value = postfix_to_int(config.get('_VALUE'))
+ settings.set('VALUE', value)
+ return settings
+
+
def process_settings(settings, config):
settings = process_settings_common(settings, config)
+ settings = process_settings_value(settings, config)
return settings