Add common value processing with aiee
This commit is contained in:
parent
f5ab76e81a
commit
7a13d25524
@ -1,3 +1,6 @@
|
|||||||
|
# external imports
|
||||||
|
from aiee.numbers import postfix_to_int
|
||||||
|
|
||||||
# local imports
|
# local imports
|
||||||
from .chain import ChainSpec
|
from .chain import ChainSpec
|
||||||
|
|
||||||
@ -28,6 +31,19 @@ def process_settings_common(settings, config):
|
|||||||
return settings
|
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):
|
def process_settings(settings, config):
|
||||||
settings = process_settings_common(settings, config)
|
settings = process_settings_common(settings, config)
|
||||||
|
settings = process_settings_value(settings, config)
|
||||||
return settings
|
return settings
|
||||||
|
Loading…
Reference in New Issue
Block a user